Skip to content

jquery-radio lets you painlessly get and set the current value of a group of radio buttons, filling a gap in jQuery's $.val. It is not a replacement for radio buttons. It just makes working with them more pleasant.

License

punkave/jquery-radio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery-radio

jquery-radio makes it easy to get or set the current value of a group of radio buttons, filling a gap in jQuery's $.val().

How to Use

Select all of the buttons in the group and call .radio():

// Check the box with value="5"
$('input.my-radio-group').radio(5);
// Get the value of the checked box
var value = $('input.my-radio-group').radio();

This example assumes you have several radio buttons that all have the .my-radio-group class.

Requirements

You need jQuery, of course. jquery-radio is actively supported with jQuery 1.9 and 2.0 but should work fine with older versions.

Changelog

0.1.3: cross browser support for IE and Firefox, which don't like the use of jQuery's attr to manipulate checkboxes very much. What does work is a combination of setAttribute and the checked property on the DOM element itself.

About P'unk Avenue and Apostrophe

jquery-radio was created at P'unk Avenue for use in Apostrophe, an open-source content management system built on node.js. If you like jquery-radio you should definitely check out apostrophenow.org. Also be sure to visit us on github.

Support

Feel free to open issues on github.

About

jquery-radio lets you painlessly get and set the current value of a group of radio buttons, filling a gap in jQuery's $.val. It is not a replacement for radio buttons. It just makes working with them more pleasant.

Resources

License

Stars

Watchers

Forks

Packages

No packages published