1.doc ument. write (""); Output statement
2. Comments in JS are //
3. The traditional HTML document sequence is: document-> html-> (head, body)
4. the DOM sequence in a browser window is: window-> (navigator, screen, history, location, document)
5. Get the name and value of the element in the form: document. getElementById ("ID of the element in the form"). name (or value)
6. javascript: document. getElementById ("output"). value = document. getElementById ("I
Nput "). value. toUpperCase ();
7. value types in JS: String, Number, Boolean, Null, Object, Function
8. Convert the numeric type in JS to the numeric type: parseInt (), parseFloat ()
9. convert numbers in JS to numeric: ("" + variable)
The string length in 10. JS is: (length)
11. The character and character in JS are connected with the + number.
12. The comparison operators in JS include: = equals ,! = Not equal to,>, >=, <. <=
13. Declare variables in. JS using: var for declaration
14. JS judgment statement structure: if (condition) {} else {}
15. loop Structure in JS: for ([initial expression]; [condition]; [upadte expression]) {inside loop}
16. The command for loop abort is break.
17. function Definition in JS: function functionName ([parameter],...)
18. When multiple form forms appear in the file, you can use document. forms [0], document. forms [1] instead.
// Http://www.bkjia.com
19. window: open window. open (), close a window: window. close (), the window itself: self
20. Set the status bar: window. status = "character ";
21. window. alert ("character ");
22. Pop-up confirmation box: window. confirm ();
23. window. prompt ();
24. Specify the position of the currently displayed link: window. location. href = "URL"
25. Retrieve the number of all forms in the form: document. forms. length
26. close the output stream of the document: document. close ();
27. String append connector: + =
28. Create a document element: document. createElement (), document. createTextNode ()
29. method for getting the element: document. getElementById ()
30. Set the value of all text members in the form to NULL:
Var form = terraform Doc ument. forms [0]
For (var I = 0; I if (form. elements. type = "text "){
Form. elements. value = "";
}
}
- Three pages in total:
- Previous Page
- 1
- 2
- 3
- Next Page