Dom manipulation of JavaScript

Source: Internet
Author: User

HTML DOM (Document Object model)

When a Web page is loaded, the browser creates a Document object model for the page.

The HTML DOM model is constructed as a tree of objects.

Windows Object Operations

    • window.open ()-Open a new window
    • Window.close ()-Close the current window

1.windows.open ("Part I", "second part", "Part Three", "Part IV")

The first part: Write page address URL

The second part: _blank open mode, in a new window (_blank) or in its own window

Part III: Features control the format of the open window, you can write multiple, separated by a space:

width=100 height=100 High and wide

Left=0 Top=0 left margin and top margin

Scrollbars=yes scroll bar appears

Resizable=no/yes whether the window can be resized

Menubar=yes has a menu bar

Status=no No status bar

Location=yes has address bar

2.windows.close (): Close the current window

Instance:

varnewwin=NewArray ();varI=0;functionNewopen () {Newwin[i]=window.open ("http://www.baidu.com", "_blank", "width=200 height=200 scrollbars=yes menubar=yes status=yes resizable= Yes Location=yes "); I++;}functionClosewin () { for(varj=0;j<i;j++) {newwin[j].close (); }}</script>

Dom manipulation of JavaScript

Related Article

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.