I have a button that when clicked uses the below funciton to add an input box to the page. How can I get it to show a label before the input box:
Name: input box goes here
function add_student(){
var StudentFirstnam e=document.crea teElement('inpu t');
StudentFirstnam e.type='text';
StudentFirstnam e.size='45';
StudentFirstnam e.name='Student 2_Firstname';
document.forms. Registration.ap pendChild(Stude ntFirstname);
}
Name: input box goes here
function add_student(){
var StudentFirstnam e=document.crea teElement('inpu t');
StudentFirstnam e.type='text';
StudentFirstnam e.size='45';
StudentFirstnam e.name='Student 2_Firstname';
document.forms. Registration.ap pendChild(Stude ntFirstname);
}
Comment