Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pepoviola/jquery.autoattachinputlabels
A simple jquery plugin to automatically attach <label> elements to adjacent checkboxes / radios
https://github.com/pepoviola/jquery.autoattachinputlabels
Last synced: 5 days ago
JSON representation
A simple jquery plugin to automatically attach <label> elements to adjacent checkboxes / radios
- Host: GitHub
- URL: https://github.com/pepoviola/jquery.autoattachinputlabels
- Owner: pepoviola
- License: other
- Created: 2014-05-08T17:10:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-08T19:19:50.000Z (over 10 years ago)
- Last Synced: 2023-03-12T02:33:02.548Z (over 1 year ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.html
Awesome Lists containing this project
README
Ever get sick of giving html check boxes and radio buttons ID attributes so that you can then attach a label to them that toggles them when it is clicked? This jquery plugin is for you. This will automatically take care of attaching labels to adjacent checkboxes / radios, and also assign unique ids to the checkboxes / radios (if they do not have one already.) Usage:
$( "body" ).autoAttachInputLabels();
Viola! All labels within the "body" element that have adjacent checkboxes or radios will be automatically attached to them. That is, the labels' "for" attribute will be automatically set to the ID of their adjacent checkbox / radio.