Have a table column I'm trying to expand and hide:
(有一个表格列我正在尝试展开和隐藏:)
jQuery seems to hide the td
elements when I select it by class but not by element's name .
(当我按类而不是按元素名称选择时,jQuery似乎隐藏了td
元素。)
For example, why does:
(例如,为什么:)
$(".bold").hide(); // selecting by class works
$("tcol1").hide(); // select by element name does not work
Note the HTML below, the second column has the same name for all rows.
(请注意下面的HTML,第二列对所有行都具有相同的名称。)
How could I create this collection using the name
attribute? (如何使用name
属性创建此集合?)
<tr>
<td>data1</td>
<td name="tcol1" class="bold"> data2</td>
</tr>
<tr>
<td>data1</td>
<td name="tcol1" class="bold"> data2</td>
</tr>
<tr>
<td>data1</td>
<td name="tcol1" class="bold"> data2</td>
</tr>
ask by T.T.T. translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…