DOM Operations: Document Object Model
"The following code is written in <script type=" Text/javascript ">
</script> Middle "
First, Window object:
window.open (' Connection address ', ' open position ', ' properties of new Window ');
New Window Properties: toolbar=no/yes New window with no toolbar
Menubar=no/yes There is no menu bar
Status=no/yes There is no status bar
Width= value, height= value width high
left= value distance to left how much
Resizable=no/yes window to school can be adjusted
Scrollbars=yes/no No scroll bars appear
Location=yes/no have no address bar
Window.close ();
Window.opener; Its parent form is not open, and this property value defaults to null
Window.resizeto (x, y); Adjust width height
Window.moveto (x, y); Move to a location
Window.scrollto (x, y); Where to scroll to the page (like an anchor point)
Second, Window.history object:
Window.history.go (n); Positive number, how many pages forward, negative number back how many pages;
Window.history.back (); Back one page
Window.history.forward (); forward one page
Third, Window.location object:
Window.location.href; Get the address of the current page
Four, Window.status object:
Window.status = "Content"; Set the text of the status bar
V. Window.document objects:
var oDiv1 = document.getElementById ("Div2"); Search by ID, find at most one
var odivclass = document.getelementsbyclassname ("C1"); Based on class, find out the array
var odivname = document.getelementsbyname ("N1"); Based on name, find out the array
var odiv = document.getelementsbytagname ("div"); Based on the tag name, find out the array
----------------------------------------------------------------
Manipulate the contents of non-form elements:
InnerHTML = "";-spelling, the browser will create the corresponding effect of the tag;
InnerText = ""; -No matter what you write, put it in intact.
If you use it alone, you get the text content in the element.
Variable name. InnerHTML-will take all the contents out.
Variable name. InnerText-will put all the contents inside, remove the mark, take out
Manipulating the contents of a FORM element: value
Variable name. Value will put all of the content inside, remove the tag, take out
Variable name. InnerHTML will take all the contents out of it.
Setting content: Variable name. value= "Content changes";
Review 1-----JS