jquery.role — jQuery plugin to provide easy way to handle DOM elements by role attribute
This project uses Semantic Versioning for release numbering.
Sponsored by Evil Martians.
Idea behind this piece of code
I start using role attrbute (
<div role="role_name"></div>) to handle DOM elements.
- Markup-guys always change classes and class names (and this is ok)
- And finally: semantic
You can use symbol '@' in jQuery selectors to find elements with roles
Will select all elements in document with
<form class="dark" role="login_form"></form>:
<form class="dark" role="login_form" method="post"></form>:
<form class="dark" role="login_form ajax_form" method="post"></form>:
- Optional usage of
- Better docs
- More tests
1.0.1 (January 27, 2012)
- Fixes problem with multiple roles in Firefox 8 and later (issue #9)
1.0.0 (December 26, 2011)
- Remove depricated function
- Rewrite in CoffeeScript
0.4.1 (December 8, 2011)
- Fix issue #8
0.4.0 (December 8, 2011)
- Added specs for jQuery Role
- Selectors performance improvement for modern browsers (also covers #6)
- Role extension for querySelectorAll function (
0.3.2 (June 2, 2011)
- Reverted changes made in 0.3.1 because issue #6
0.3.1 (May 24, 2011)
- Selectors performance improvement for modern browsers
0.3.0 (May 23, 2011)
- Added native Sizzle selectors support (
0.2.0 (May 20, 2011)
- Added mechanism to pick roles by element id
0.1.0 (May 05, 2011)
- Initial release
Original idea by @kossnocorp and @ai.
The MIT License
Copyright (c) 2011 Sasha Koss
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.