----------Summary
01. Finding DOM Elements
document.getElementById ();//Get a DOM element by ID
Document.getelementsbyclassname ();//Get DOM array by class
document.getElementsByTagName ();//get DOM array by tag name
02. Modifying DOM elements
Dom.type = "Text"//type property
dom.innerhtml//double Label text value here note innertext
dom.value//Modify the text value of a single label, such as input
document.getElementById (). style.height//Note styles need to be added by style points, height, width need to add units
03. Delete DOM Elements
DOM element. Parentnode.removechild (DOM Element)//dom elements cannot delete themselves, they must be deleted by the parent element
The deleted DOM element is still in memory, just removing it from the DOM tree.
04. Creating DOM Elements
Document.createelement ("input");//In JS All DOM elements are created in this way, passing in different tag names, returning different elements
DOM element. AppendChild (NewNode)//Create good DOM elements you have to add him to the DOM tree to see it.
05. Cloning DOM Elements
DOM element. CloneNode (TRUE);//All DOM elements have this method, passing in false only clones the element itself, passing in true child elements together to clone
06.a Tag introduces JS code
<a href= "javascript: Write JS code here" > Test with </a>//in javascript: after writing JS code
Special for 07.select labels
01. You can modify the selected option by setting the Select.value. However, the value set must have the option tag present, otherwise no effect
02. Modify the selected option tag to trigger the onchange event for the Select tag
08. Second way to bind level 0 DOM events
<input type= ' button ' onclick= ' is written here is the JS code ' >//Note this binding method body inside this
09. Get the parent node quickly
DOM element. parentnode
10. Note
When writing JS may not prompt, bold write up to!!!!!
<! DOCTYPE html>
<! DOCTYPE html>
<! DOCTYPE html>
<! DOCTYPE html>
<! DOCTYPE html>
<! DOCTYPE html>
<! DOCTYPE html>
<! DOCTYPE html>
A tentative study of JavaScript two