Jump to content

document.createElement exists?


bbala

Recommended Posts

is createElement a standard method for the document object?? Im not able to find this in reference at http://www.w3schools.com/jsref/dom_obj_document.aspBut it is used at someplaces in w3schools itself. eg. http://www.w3schools.com/jsref/met_select_add.asp

Link to comment
Share on other sites

It's a standard. The reference is here:http://www.w3schools.com/dom/met_document_createelement.asp
This takes to the xml DOM document object. Is both XML DOM document object and the HTML DOM document object the same??All the methods defined in xml DOM document will work for html also?
Link to comment
Share on other sites

The XML DOM and HTML DOM do have differences but in this case createElement works the same.

var myDiv = document.createElement("div");

I could not find document.createElement in the JavaScript tutorial which is a bit odd.If you are interested here it is in the Mozilla Javascript reference.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...