删除复选框,我有如下一个HTML表格:有一个“无效”状态
<table>
<thead>
<tr>
<th><input type="checkbox" id="selectall" /></th>
<th colspan="2">Status</th>
<th class="data-name">UserName</th>
<th class="data-name">Description</th>
</thead>
</table>
的状态使用文本来指示活跃和不活跃用户。在这里,我试图显示一个错误消息,如果有人试图删除状态为'active'的复选框。只有“不活跃”的用户才能被删除。 我正在寻找一个jQuery代码。有人能帮我吗? 我提供了一个我想要实现的sudo代码。这可能在语法上不正确。
if $('#selectall input[type="checkbox"]:checked') is 'active'
{
alert('do not delete the checkbox');
}
else
{
alert('delete the checkbox');
}
而这是哪里'active'和'inactive'文本? – adeneo
您的意思是...... **残疾人** ** – Cilan
为什么不只是禁用复选框,如果该行是“活动的”,阻止它首先被检查?这将为用户提供更明确的方向。 –