标签:
<div class="row">
<table>
<thead><tr><th>操作</th></tr></thead>
<tbody>
<tr>
<td>
<input type="radio" name="3" value="Update" />覆盖
<input type="radio" name="3" value="Insert" />更新
<input type="radio" name="3" value="Cancel" />取消
</td>
</tr>
<tr>
<td>
<input type="radio" name="2" value="Update" />覆盖
<input type="radio" name="2" value="Insert" />更新
<input type="radio" name="2" value="Cancel" />取消
</td>
</tr>
<tr>
<td>
<input type="radio" name="5" value="Update" />覆盖
<input type="radio" name="5" value="Insert" />更新
<input type="radio" name="5" value="Cancel" />取消
</td>
</tr>
</tbody>
</table>
<input type="button" id="btnTry" value="更新" />
</div>
<script type="text/javascript" src="~/Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
jQuery("#btnTry").click(function () {
var updateIds = ‘‘;
$(‘input:radio[value="Update"]:checked‘).each(function (i, val) {
updateIds += val.name+‘;‘;
});
var insertIds = ‘‘;
$(‘input:radio[value="Insert"]:checked‘).each(function (i, val) {
insertIds += val.name + ‘;‘;
});
alert(‘Update:‘+updateIds);
alert(‘Insert:‘+insertIds);
});
</script>
标签:
原文地址:http://www.cnblogs.com/jimcsharp/p/5951549.html