Basic syntax: Data type (string, Decimal, Integer, Boolean, time) Var,
var s = "3.14"; var n = parsefloat (s);; s + = 5;
var d = parseint (s);
IsNaN (String): A string that determines if it is a digital shape;-false; not-true.
Operators: Four categories
An expression:
Statements: three major classes (sequential, branching, looping)
Branch: if () {}; If...else ...; If...else if...else If ... else;if nested
Cycle: exhaustive, iterative; four elements (initial conditions, cyclic conditions, loop bodies, state changes):
Array; var a = new Array ()
Functions: Four elements (name, input, return, processing)
function Show ()
{
}
Second, Dom operation: Tree
Window Object--browser windows
Window.location: Address bar
Window.history: Access History
Window.status: Status bar
Window.document: Focus!
Third, document:
1. Find
var d = document.getElementById ("ID of element");
var d = document.getelementsbyname ("element name")
var d = document.getelementsbytagname ("label name")
2. Operating element content:
(1) Form element: Text (Input:type=text,input:type=password;textarea;input:type=hidden) button (Submit,reset,button image) selection (radio , Checkbox,select,file)
d.value=xxxx;
var s = d.value;
(2) Non-form elements: H1...h6,p,div,ul,ol,li
d.innerhtml = xxxx;
var s = d.innerhtml;
3. Manipulating element properties:
D.setattribute (name, value)
var s = d.getattribute (name)
D.removeattribute (name);
4. Operation element Style:
(1) Inline style:
D.style.backgroundcolor = "#FFFF00";
var s = d.style.backgroundcolor;
(2) Class attribute:
D.classname= ""
5. Operation Related elements:
Up, down, inside, outside
6, web-making Dreamweaver (HTML structure--dom operation)