Confessions of the Author:
Know a general principle and meaning, this can reduce the actual operation of the error, the use, can be more handy.
1. Identify the object. (Know who you want to work with)
HTML to the Web page control, CSS to the style of the Web page, JS to provide Dynamic Web page effect, specifically the user's interaction (event), when the user through the input device to give the browser an event information, the browser to respond to the user. How the browser back to the user, the browser HTML file, so JS is the object of the HTML control and HTML elements of the style. objects need to correspond to the needs, it is easier to achieve the effect, more easily come up with the steps to achieve. (You cannot manipulate the object with a method that is not the object, clear the system of the entire api/library)
Example: Var a=13;//an object of type number
var obj={"name": "Marya", "Age": "18",}//an object of type objects
var str= "hello,my friend";//an object of type string
var Obj1=document.getelementbyid ("div");//An HTML Document node object
2 Use the object. (Smooth operation of the object, so that the object to complete the mission)
After the successful acquisition of the Document object by JS scripting language, it is necessary to use the code block that JS can understand and execute to get the object to complete its mission.
Example: Var a=0,b=3,c;//defining an object, let's manipulate the object with the variable name
c=a+b;//manipulating objects
var Obj1=document.getelementbyid ("div");//Get it and put it in obj1.
Console.log (Obj1.nodename); View Obj1 's NodeName properties (real business implementations, with more complex operations)
JS Dom Learning Note two