HTML DOM Fourth article

Source: Internet
Author: User

Access HTML DOM-find HTML elements.

Accessing HTML elements is equivalent to accessing nodes

You can access HTML elements in different ways:

  • Returns an element reference with the specified ID by using the getElementById () method:
  • Returns all elements with the specified label name by using the getElementsByTagName () method
  • Finding all HTML elements with the same class name by using the Getelementsbyclassname () method is not valid in Internet Explorer 5,6,7,8.

Modify HTML = change elements, attributes, styles, and events.

Modifying the HTML DOM means a number of different things:

  • The simplest way to change the content of an HTML content element is to use the InnerHTML property
  • Change CSS Style
  • Changing HTML Properties
  • Create a new HTML element
  • Delete an existing HTML element
  • Change event (Handler)

HTML DOM Fourth article

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.