特定TR我得到这个表HTML:如何选择基于属性值
<table id="mytable">
<thead>
<tr role="row">
<th aria-controls="dog"></th>
<th aria-controls="cat"></th>
<th aria-controls="fish"></th>
</tr>
</thead>
</table>
,我想选择个地方的属性是“狗”。
我试试这个:
$("th").attr("aria-controls"="dog");
什么是神的方式来做到这一点?
如果我可以避免循环所有的tr它会更好。
谢谢:)
你不试试这个,因为它是一个语法错误。你刚刚谷歌。 – nicael