Code example of jquery single-choice button and jquery single-choice button
Sample Code for jquery single-choice buttons:
The radio button is one of the most important form elements. The following describes some commonly used jquery operations on the radio button.
1. deselect:
$ (". Theclass "). each (function () {if ($ (this ). attr ('checked') {$ (this ). attr ('checked', false );}});
The code above can unselect the selected single-choice button with the class property value being theclass.
2. Obtain the value of the selected radio button:
Var val = $ ('. theclass: checked'). val ();
The above code obtains the value Attribute value of the selected button in the single-choice button with the class attribute value being theclass.
The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 11422.
For more information, see: http://www.softwhy.com/jquery/