Element gets
1. Document.getelementsbyclassname (' class ') gets the element through the class name, in the form of an array of classes.
2. Document.queryselector (' div ') gets the element through the CSS selector and matches the 1th element of the match condition.
3. Document.queryselectorall (' selector ') gets the element through the CSS selector, in the form of an array of classes.
Class name Operation
1, Node.classList.add (' class ') Add Class
2. Node.classList.remove (' class ') to remove class
3, Node.classList.toggle (' class ') switch class, have remove, none add
4. Node.classList.contains (' class ') detects if there is a class
Custom properties
1. Custom attribute format: data-*= "", for example data-info= "informant".
2, custom property acquisition: The above example, through node.dataset[' info '] we can get to the custom property value informant
3, Node.dataset is in the form of a class object, when we set the following format, we need to get the hump format correctly: Data-my-name= "Itcast", get node.dataset[' myName ')
Html5--dom extension