Example of how to use jquery to operate HTML5 data-* _ jquery

Source: Internet
Author: User
From jQuery1.4.3, The HTML5data-attribute will be automatically referenced to the jQuery data object. That is to say, although data-* is an element in html5, if jquery1.4.3 and above are used. it can still be used on non-HTML5 pages or browsers. data (obj) method to Operate & quot; data-* & quot; data. after reading the HTML5 detailed specifications, you will find that the usage of this custom data attribute is very simple, that is, you can add any attribute starting with "data-" to the HTML Tag, these attribute pages are not displayed. They do not affect the layout and style of your pages, but are readable and writable.

This method has been built in jquery. by $ ('# content '). data ('LIST'); to obtain data. this method appears after jQuery1.4.3. It returns the corresponding data attribute.





Use of jquery to operate HTML5 data -*

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.