/*
* Common way to get elements
* 1. Get element document.getElementById (' attribute name ') by ID
* 2. Get the element document.getelementsbytagname (' attribute name ') by signing it;
* 3. Use the Class property to get the element with compatibility problem Document.getelementsbyclassname (' class attribute name '); get an array
* 4. There is a compatibility problem with the Document.getelementsbyname (' name Attribute name ') by using the Name property to get the element; Returns an array
/*
* Node Parent-child relationship Lookup
* 1. Get all the child nodes, including spaces and tabs, etc.
* A. Get elements first
* B. element name. childNodes;
* 2. Get all the label nodes
* element name. Child;
* 3. Get the first child node
* element name. firstchild;
* 4. Get the first tag element
* element name. firstelementchild;
* 5. Get the last child node
* element name. lastchild;
* 6. Get the last tag element
* element name. Laseelementchild
* 7. Gets the previous element of the current element
* element name. previoussibling
* 8. Get the previous LABEL element
* element name. previouselementsibling
* 9. Get the next node
* element name. nextSibling
* 10. Get the next tag element
* element name. nextelementsibling
* 11. Get the parent element from the element
* element name. parentnode;
* 12. Parent element Node
* element name. parentelement
*/
/*
* Quick way to get element nodes
* 1. Get the node document.forms for all forms;
* 2. Get all the A-tag node document.links;
* 3. Quick access to IMG tag nodes
* a.document.images;
* b.document.getelementsbytagname (' tag name ');
*/
/* Actions for tag elements
* 1. Add the attribute of the element, add the class attribute
* a.setattribute (' attribute name ', ' attribute value ');
Property change CSS Style
* B.setattribute (' class ', ' attribute name ');
* 2. Remove removeattribute (' attribute name to remove ');
* 3. Get the attribute getattribute (' attribute name ');
* Operation of label text
* 1. Acquisition of text
* a.innerhtml, you can get the tag attributes and values of the element
* b.textcontent can only get plain text, cannot get the middle label
* 2. Set the value of the text InnerHTML = "value to be assigned"
* Style of operation
* 1. Modification of the style
* A. Gets the properties of the class document. (images,links,forms)
* B. Assigning a value using a For loop
* 2. Get the Style: property name. style. Styles
*/
JS Common method gets element, node parent-child relationship Lookup