JQuery learning notes [1] DOM operations in jQuery _ jquery

Source: Internet
Author: User
Implementation of DOM operations in jQuery. For more information about DOM operations, see. DOM is divided into three aspects, namely DOM Core, HTML-DOM, CSS-DOM.
1. DOM Core is not specialized in JavaScript. It can be used by any programming language that supports DOM.
GetElementById (), getElementsByTagName ()... and other methods in JavaScript.
For example, you can use DOM Core to obtain form objects:
Document. getElementsByTagName ("form ");
2, HTML-DOM.
When using JavaScript and DOM to write scripts for HTML files. there are many properties dedicated to HTML-DOM. the appearance of HTML-DOM is even earlier than DOM Core, which provides more concise marks to describe the attributes of various HTML elements.
For example, the way to get form objects using a HTML-DOM:
Document. forms // The HTML-DOM provides a forms object.
3, CSS-DOM
CSS-DOM is the operation for CSS. In JavaScript, CSS-DOM technology is mainly used to obtain and set various attributes of style objects.
For example, you can set the font color of an element style object: element. style. color = "red ";
The following describes the DOM operations in jQuery:
First construct a DOM tree:

The Code is as follows:






DOM operations in jQuery


What is your favorite fruit?



  • Apple

  • Orange

  • Pineapple





The subsequent operations are centered around the DOM tree.
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.