Skip to content

Instantly share code, notes, and snippets.

@elijahmanor
Created July 19, 2011 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahmanor/1091327 to your computer and use it in GitHub Desktop.
Save elijahmanor/1091327 to your computer and use it in GitHub Desktop.
Selector Using HTML5 Data Attributes
var valueImLookingFor = "myvalue";
//The string concatenation just feels wrong to me...
$( "p[data-mytype" + "='" + valueImLookingFor + "']" )
.doSomething();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment