【发布时间】:2019-07-20 17:29:04
【问题描述】:
我想在其 CSS 包含特定背景颜色(bgcolor 属性)的表中选择一堆 td。我如何做到这一点?
我尝试过$("[bgcolor=#FF0000]"),但出现错误。 Uncaught DOMException: Failed to execute '$' on 'CommandLineAPI': '[bgcolor=#FF0000]' is not a valid selector.
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td bgcolor="#FF0000">January</td>
<td bgcolor="#00FF00">$100</td>
</tr>
</table>
【问题讨论】: