Created
February 12, 2014 08:54
-
-
Save Irfan-Ansari/8952066 to your computer and use it in GitHub Desktop.
Jquery Selector by data attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Select by specific element type, attribute and value | |
$("div[data-myattr='myvalue']").doSomething(); | |
// Select by specific element type and attribute | |
$("div[data-myattr]").doSomething(); | |
// Select by specific attribute | |
$('[data-myattr]').doSomething(); | |
// See more: http://api.jquery.com/contains-selector/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment