【发布时间】:2014-01-02 02:36:30
【问题描述】:
嗨,我正在尝试制作一个我需要制作的函数
选中单选按钮
根据按钮属性值
应该等于单选按钮的值。
下面是我的代码
<table id="oustandingItems">
<tr><th>Category</th></tr>
<tr><td><input type="radio" name="mytest" value='124' /></td></tr>
<tr><td><input type="radio" name="mytest" value="123"/></td></tr>
</table>
<button title ="124" class="findRow">Find Row</button>
<button title ="123" class="findRow">Find Row</button>
$(".findRow").click(function() {
var rad = $(this).attr('title');
//alert($(this).attr('title'));
var myValue = $('#oustandingItems').find('input[value=rad]').val()
alert(myValue);
//$("#myRow").val(myValue);
});
我需要检查单选按钮谁的值将等于按钮标题值
<button title ="124" class="findRow">Find Row</button> <button title ="123" class="findRow">Find Row</button>
但这不起作用,请建议我如何实现这一目标
谢谢
【问题讨论】:
标签: jquery attributes click radio