我正在禁用基于复选框的表单…
<table id="shipInfoTable"> <tr> <td>Name:</td> <td><input type="text" name="name" /></td> </tr> ... </table>
Javascript选择器/属性操作(jquery):@H_403_3@
$("#shipInfoTable tbody tr td input").each(function(index,item){ item.attr("disabled",true); });
Chrome Dev Console错误:
未捕获的TypeError:对象#<一个HTMLInputElement>没有方法’attr’@H_403_3@
当我警告.each()中的项目时,它会发出警告[object HTMLInputElement]@H_403_3@
不太确定如何正确选择输入元素.我究竟做错了什么?@H_403_3@