Thursday, August 18, 2011

JAVA SCRIPT TO CREATE NEW HTML FIELD


function createNewTextField(){

                                var parent=document.getElementById("container");
var newfield = document.createElement('input');
    newfield.type = 'text';
newfield.id ="userName";
newfield.size ="11";
newfield.setAttribute("value","RK");
newfield.setAttribute("name","userName");
newfield.setAttribute("onblur","validateUserName()");
parent.appendChild(newfield);
}

No comments:

Post a Comment