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.$ (' input[name= ' Testradio "]:checked '). Val (); 2,
1.$ (' input:radio:checked '). Val (); 3,
1.$ (' input[@name = ' testradio '][checked] '); 4,
1.$ (' input[name= ' Testradio "]). Filter (': checked '); it's pretty much all right, if we're going to traverse all the Testradio of name Radio, here's the code.
1.$ (' input[name= ' Testradio "]). each (function () {2.alert (this.value); 3.}); 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 ()
The above is online, for a moment:
<table class= "Table table-bordered" >
<thead>
<tr>
<th style= "Vertical-align:middle" class= "Text-center" rowspan= "2" > radio button Operation </th>
</tr>
</thead>
<tbody>
#foreach ($item in [1,2,3,4,5])
<tr>
<td>
<input type= "Radio" name= "audit$! {Item} "value=" 1 "checked> by
<input type= "Radio" name= "audit$! {Item} "value=" 0 "> Dismissed
</td>
</tr>
</table>
The above dynamic, each row has a pair of radio radio, at this time to get the value of each row selected, the code is as follows:
$ ('input:radio:checked'). each (function () {
var CheckValue = $ (this). Val ();
Console.log ($ (this). Val ()); The value in the check box
});
jquery Gets the value of the selected radio button radio in the loop