Dom manipulation of Javascrip

Source: Internet
Author: User

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

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.