1. Events
Body event
Onload onunload onbeforeunload
Common events
Onclick, ondblclick, onkeydown, onkeypress, onkeypress, onkeyup, onmousedown, onmousemove) onmouseout, onmouseover, onmouseover, and onmouseup
2. dynamically setting events is similar to registering events in net.
Document. ondbclick = f1; // set the event handler function of document. ondbclick to f1.
3. The current browser window of the window object upload handler Doc ument. body
Method
Alert ()
Confirm ("OK? ")
Navigate ("http://www.baidu.com ");
Var timerId = setInterval ("alert ('hello')", 500 );
ClearInterval (timerId)
SetTimeout ()
ClearTimeout ()
ShowModalDialog ("window.htm") mode form
ShowModelessDialog ("window.htm") Non-modal form
Attribute
Window. location. href
Window. location. reload () refresh the page
Window. event
AltKey
CtrlKey
ShiftKey
ReturnValue cancels subsequent content execution
Event source caused by srcElement
Key value when keyCode triggers an event
When a button triggers an event, the mouse key 1 is the left button, 2 is the right button, and 3 is the left and right keys at the same time.
Screen Resolution
Width
Height
ClipboardData clipboard
GetData ("Text ")
SetData ("Text", val)
ClearData ("Text ")
History
Back () go (-1)
Forward () go (1)
Document
Method
Write ()
Writeln ()
GetElementById ()
GetElementsByName ()
GetElementsByTagName ()
CreateElement ()
AppendChild ()
4. Get Element Content
Value
InnerText
InnerHTML
5. dynamically modify element styles
This. style. backgroundColor
This. style. fontSize
This. style. marginTop
This. style. display = "none" hide "" display
This. style. width = "18px"
6. form object
Event
Onsubmit
Method
Submit ()