1, the basic concept of the DOM
Dom is the Document Object model, which is a tree model, a document refers to a label document, and an object refers to each element in a document; A model refers to something abstracted.
2. Windows object Operations
I. Properties and Methods
Ii. window.open ("Part I", "Part II", Part III "," Part IV ")
Third, Window.close (): Close the current window;
Iv. interval and delay
Interval executes a piece of code (function): Window.setinterval ("Code to execute", the number of milliseconds between intervals);
Cleanup interval execution: Window.clearinterval (the ID of the interval), the code that is used to clear the interval execution after a loop;
Delay a period of execution of a piece of code (function): Window.settimeout ("Code to execute", number of milliseconds delayed);
Purge delay: window.cleartimeout (delayed ID); clear settimeout;
Five, adjust the page
Vi. modal dialogs and non-modal dialog boxes
3. Windows.history Object
4. Windows.location Object
5. Windows.status Object
6. Windows.document Object ☆
First, find the element
Ii. Elements of Operation
1. Non-form elements:
1) Get content
2) Set Content
2. Form elements
1) Get content
2) Set Content
3. A small Knowledge point:
Third, Operation Properties
Four, Operation style
Example: manual automatic switching of display pictures
Source
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">CSS style Sheets
@charset "Utf-8";/* CSS Document */*{ margin:0px Auto; padding:0px;} #tuijian { width:270px; height:270px; Background-repeat:no-repeat; Background-position:center;}. pages{ top:250px; Background-position:center; Background-repeat:no-repeat; opacity:0.4; width:60px; height:60px;} #p1 { background-image:url (left2.png); Float:left; margin:150px 0px 0px 10px;} #p2 { background-image:url (right2.png); Float:right; margin:150px 10px 0px 0px;}
Dom manipulation of Javascrip