19
我有两个单选按钮。我希望能够获得选中单选按钮的自定义属性“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
- 但我不断收到 “未定义”。
任何想法?
我不知道我在想什么。非常感谢。它按预期工作。 – Meek