【发布时间】:2013-05-30 18:29:33
【问题描述】:
我有两个单选按钮。我希望能够获取选中的单选按钮的自定义属性“xmlvalue”的值。
我已尝试使用以下脚本:
var userType = $("input[name=ctrl_CustomerType]:checked", this).attr('xmlvalue');
标记:
<input type="radio" name="ctrl_CustomerType" id="ctrl_CustomerType_1" xmltag="CustomerType" xmlvalue="existingCustomer" checked="checked"> Yes
<br />
<input type="radio" name="ctrl_CustomerType" id="ctrl_CustomerType_2" xmltag="CustomerType" xmlvalue="newCustomer"> No
-- 但我不断收到“未定义”。
有什么想法吗?
【问题讨论】:
标签: jquery radio-button attr