JQuery tag element attribute usage example _ jquery

Source: Internet
Author: User
This article mainly introduces the usage of tag element attributes used by jQuery. The example shows how jQuery controls the page, this section describes how to use attributes of elements, css styles, DOM models, form elements, and Event Processing. For more information, see the following example. Share it with you for your reference. The specific analysis is as follows:

This section describes how to use jQuery to control pages, including attributes of elements, css styles, DOM models, form elements, and event processing.

Tag element attributes

Each tag in html has some attributes, and the tag shows various states in the page, such as the following tag

The code is as follows:

This tag indicates the name of the tag. it is a hyperlink. In addition, attributes such as href titile target id indicate the status of the hyperlink on the page.

This article explains how to control page attributes from the jQuery perspective.

1. each () traversal element

The each (callback) method is mainly used to traverse the elements in the selector. it accepts a function as a parameter. this function accepts a parameter to indicate the sequence number of the element. For tagged attributes, you can use the each () method with the this keyword to obtain or set the attribute values corresponding to each element in the selector.

Use the each () method to traverse all elements.

The code is as follows:

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.