我正在尝试在单击loadActive链接时禁用这些单选按钮但由于某种原因它只会禁用顺序中的第一个,然后跳过其余按钮.
<form id="chatTickets" method="post" action="/admin/index.cfm/">
<input id="ticketID1" type="radio" checked="checked" value="myvalue1" name="ticketID"/>
<input id="ticketID2" type="radio" checked="checked" value="myvalue2" name="ticketID"/>
</form>
<a href="#" title="Load ActiveChat" id="loadActive">Load Active</a>
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的jquery:
jQuery("#loadActive").click(function() {
//I have other code in here that runs before this function call
writeData();
});
function writeData() {
jQuery("input[name='ticketID']").each(function(i) {
jQuery(this).attr('disabled', 'disabled');
});
}
Run Code Online (Sandbox Code Playgroud) jquery ×1