2, the code from the top down, from left to right to execute. Where the function declaration is not important, it is important where it is called. Undefined undefined 3, data type
12,5 Number ' abc ' String
4, the difference between the string and the variable, there is no 5 before the quotation mark, can pass multiple parameters, multiple parameters separated by commas. 6, the operation of the attributes with points or brackets.
obox.style,background= ' red '; obox.style[' background ']= ' red ' points manipulate existing attributes, and brackets can square variables. , as long as the point appears, the brackets must be replaced by the following: the usual use is. Relatively simple []: used when the name is variable. More flexible obj. property name Gets the value of the property obj. property name = value Setting
7. The function encounters parentheses immediately executes the btn.onclick= method name without parentheses
8, anonymous function: No Name function, only used in the case of events only use, also known as the event function 9, window.onload=function () {}; Wait for the browser to load the finished page to execute 10, window.onload the second step gets the element third step execution Event 11 , document.getElementById (' id ')//Gets a set of elements document.getElementsByTagName (TagName) cannot directly manipulate a set of elements subscript starting from 0 arr[Subscript] 12, Loop (4 steps) Definition: operation of a set of elements
1, initialization 2, Condition 3, Statement 4, self-increment
while (condition) {statement}, for (Var i=0;i<length;i++) {}//More Jincu 13, this: represents the element that triggered the event. Who triggered the event is who 14, custom attribute low version browser so that the advanced (Web-compliant) browser is not supported. Advanced browsers will filter out any attributes that are not present in the Web-only specification.
Web page Implementation Section three: 1, the HTML JS CSS to take over 2, the analysis of "The inside of the screen is not standard filter out, filter only once", with JS Plus custom attributes. 3. Execute code
1.1 JS Basics