First, what is DOM?
Document Object Model Documents
When creating a Web page and loading it into a Web browser, if there is no document (DOC);
Dom creates a document object based on the Web page document you write
The objects in the Javascipt language are divided into three categories:
1. User-defined objects (User-defined object): objects created by programmers themselves
2. Built-in objects (native object): Built into JavaScript language objects, such as Array Math and date
3. Host object: A browser-provided object (Window object)
Window objects correspond to the browser window itself. The properties and methods of this object are generally referred to as the BOM (browser object model) BOM to provide programmers with window.open () and window.onload ();
Example: You see a variety of pop-up window drop-down menu when you are on the Internet, almost all have a BOM method responsible for creating and processing
Var array= "1, 2, 3, 4"
We now want to put the 7 number behind this array.
Want is "1, 2, 3, 4, 7"
Push () pushes in from behind
Example: var arr = "1, 2, 3, 4"
What I want is to put 7 in this array.
Arr.push (7)
Console.log (arr);
Instance:
Arr.unshift (10) put in front of the array
Console.log (arr)
Instance: removing from the back
Arr.pop ()
Console.log (arr)
Instance: removing from the front
var AA = "11, 12, 13"
var sum = aa. Concat (arr)
var zoom = Arr.concat (AA)
Console.log (sum);
Console.log (zoom);
Converts an array to a string join (the function joins the individual elements in the array into a string by making a delimiter)
Console.log (Arr.join ("-"));
Convert a string to an array
var txt = "AA-BB-CC"
Console.log (Txt.split ("-"))
JS is a few parts of the composition
Core (ECMAScript) DOM BOM
Ecmaascipt European computer maker organization
Dom methods and interfaces for handling Web page content
The method and interface of BOM and browser interaction
Dom Tree
Tag tag element node
Structure diagram The entire document is a document node
Each HTML tag is a node of an element
The text in the tag is the text node
The attribute in the tag is the attribute node
getElementById Accessing nodes by ID
Getelementbytagname () Tag Access node
Getelementbyclassname () class name
Getting started with Dom animation effects basics