Home >Web Front-end >JS Tutorial >Sharing usage examples of jquery operating HTML5 data-*_jquery

Sharing usage examples of jquery operating HTML5 data-*_jquery

WBOY
WBOYOriginal
2016-05-16 16:39:281204browse

After reading the detailed specifications of HTML5, 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 attributes will not be displayed on the page. , it will not affect your page layout and style, but it is readable and writable.

This method is already built into jquery. Data can be obtained through $('#content').data('list');. This method appeared after jQuery version 1.4.3, and it can return the corresponding data attribute. .





Usage of jquery to operate HTML5 data-*