Core dom:
object: document,node, elementnode,textnode,attributenode,commentnode,nodelist
The core DOM provides a unified interface for Operations:
CreateElement
AppendChild
SetAttribute
RemoveAttribute
NodeName
The core DOM creates a new element:
var newnode=document.createelement ("img")
To add an attribute to an element:
E.setattribure (",")
E.setattriburenode (attr)
Applicable occasions:
The core DOM is suitable for manipulating nodes, such as creating, deleting, finding, etc.
HTML DOM:
object:Image,table,form,input,select ... HTML Tag Object
The HTML DOM provides a variety of encapsulated objects:
Image
Select
Option
HTML Dom creates a new element:
var newnode=new Image ();
To add an attribute to an element:
Img.src= ";
Img.id= ";
Imd.title= ";
Img.classname= "
img.style.display= ";
Applicable occasions:
HTML Dom is suitable for manipulating properties, such as reading or modifying the value of a property
The difference between the core DOM and the HTML DOM