Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support periods in data attribute selectors #76

Closed
ryanve opened this issue Oct 26, 2011 · 2 comments
Closed

Support periods in data attribute selectors #76

ryanve opened this issue Oct 26, 2011 · 2 comments

Comments

@ryanve
Copy link

ryanve commented Oct 26, 2011

Sizzle supports data attribute selectors when they include dashes and underscores, but not when they include periods. This would be useful. Periods are valid in the naming rules.

data-example1.0="This is a valid in HTML5 "
data-example1-0="This is a valid in HTML5 "

$( '[data-example1-0]' ) // Targetable in jQuery.
$( '[data-example1.0]' ) // Throws "unrecognized expression" Sizzle error in jQuery.

@timmywil
Copy link
Member

Periods just need to be escaped. This is also the behavior of querySelectorAll. http://jsfiddle.net/timmywil/x8rsr/

@ryanve
Copy link
Author

ryanve commented Oct 26, 2011

Sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants