Example Explanation:
This code creates a new <p> element:
var para=document.createelement ("P");
To add text to the <p> element, you must first create a text node. This piece of code creates a text node:
var Node=document.createtextnode ("This is the new paragraph. ");
Then you must append the text node to the <p> element:
Para.appendchild (node);
Finally, you must append this new element to an existing element.
This code finds an existing element:
var Element=document.getelementbyid ("Div1");
This code appends a new element to the existing element:
Element.appendchild (para);
var doc=document.createelement ("div"); Create P Element
Doc.innerhtml= ' <input name= "text1[]" onblur= "TJ ()" type= "text"/> <input name= "text" Name= "text2[]" type= " Text "/> <input name=" text "Name=" text3[] "type=" text "/>";//Create Text node
var Objdiv=document.getelementbyid ("D"); Objdiv.appendchild (doc);//Add elements to the specified div! You can test it!
Appending a node after a JavaScript div element