Select elements by HTML5 data attribute in jQuery

后端 未结 4 709
闹比i
闹比i 2020-12-24 00:39

Is it possible to select elements in jQuery by their HTML5 data attributes (for example, all

with data-role=\'footer\')?

4条回答
  •  天涯浪人
    2020-12-24 01:19

    jQuery Mobile recomends the $.fn.jqmData(), for example : $("div:jqmData(role='footer')")

    Source: http://jquerymobile.com/test/docs/api/methods.html

提交回复
热议问题