Review 1-----JS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.