Event (Event listener):
The label object. Event listener. Function () {Execute code, find object, Find property, change property};
The event source. Triggers an event. Call a method. Method find the execution code to find the object, find properties, change attributes (or use attributes, additions and deletions to change)
onmouseover Mouse moves over an element
onmouseout mouse away from an element
onkeydown Keyboard Press down (just keep pressing)
onkeypress Keyboard Press down and then release (just click Down and then release)
oonkeyup Keyboard Release (when it is loosened)
onclick Mouse Press down and then up (click)
onmousedown mouse button pressed (press not move)
onmousemove Mouse movement (moving and not pressing)
onmouseout Mouse over an element (when mouse is on)
onmouseup mouse button release (when Mouse is released)
onresize window or frame is resized
window.onresize
onsubmit form Submission
onblur element loses focus
onfocus Element gets focus
width and height of the browser's blank area (ie, browser width and height)
width: document.documentElement.clientWidth;
High: document.documentElement.clientHeight;
How to get Objects:
window.document.getElementById (' Miao ');//window can be omitted
document.getElementById (' Miao ');//id is unique, not conflicting, so gets an object value, not an array
document.getElementsByTagName ("a");//tag name is not unique get all a tag object, generate array
Document.getelementsbyclassname ("a");//classname is not unique, gets all the classname for a label object to generate an array
Document.getelementsbyname ("a");//name property is not unique, gets all label objects with Name A, generates an array
is the entire label .
after you get the object, you can call the object's innerHTML property if you want to get the contents of the tag
The label object. InnerHTML: Represents the text between tags
The Label object. InnerHTML = new data: The assignment of content between tags
Bullet Box:
alert (): A regular pop-up window
confirm (): pops up a popup with confirmation and cancellation
prompt (): Popup with Input box
setTimeout (func,n);//timer, n seconds after executing the program in Func, in milliseconds
Common methods of JS