Using jquery to get the value of radio, the most important thing is to master the use of the jquery selector, in a form we usually want to get the selected radio
The value of the item, so add checked to the filter, such as the following radio:
1.<input type= "Radio" name= "Testradio" value= "jquery Get Radio Value"/>jquery get Radio value
2.<input type= "Radio" name= "Testradio" value= "jquery Gets the value of the checkbox"/>jquery get the value of the checkbox
3.<input type= "Radio" name= "Testradio" value= "jquery Gets the value of select"/>jquery get the value of select
To get the value of a radio, there are several ways to give the code directly:
1, 1.$ (' input[name= ' Testradio "]:checked '). Val ();
2, 1.$ (' input:radio:checked '). Val ();
3, 1.$ (' input[@name = "Testradio"][checked]);
4, 1.$ (' Input[name= "Testradio"]). Filter (': Checked ');
Pretty much, if we're going to go through all the radio name Testradio, the code is 1.$ (' Input[name= "Testradio"] '). each (function ()
{alert (this.value);});
If you want to take the value of a specific radio, such as the value of a second radio, write
1.$ (' input[name= ' Testradio "]:eq (1) '). Val ()