Window.Document.createElement can dynamically generate an HTML object and can use the AppendChild method of the HTML object to add an automatically generated HTML object to a HTML object.
The usage of window.document.createElement is as follows:
Var linkobj = window.document.createElement ("a");
This generates a connection object. It returns the generated object reference, and the LINKOBJ on the upper side accepts this object reference, and we can be able to perform various controls for the generated HTML objects over the returned object.
For example: linkobj.href = "http://isoft.ispcn.com"; linkobj.innertext = "Connection Object"; linkobj.style.color = "red";
After generating an object, we can add it to the current page existing objects:
Window.Document.body.Appendchild (LinkObj);
code show as below: