开发者

hide all td's with same id with jquery

<td id="valhisprofitVal"><%= Math.Round(profit, 5) 开发者_运维百科%>%</td>

These rows are added dynamically, so there can be multiple rows with the same Id.

How do I hide all of them using Jquery?


You can't. Only one element can have its own ID, you can't share the same ID among multiple elements. And because of that, if you try to use JavaScript to find elements with the same ID, you'll only obtain the first of those elements.

Use a class instead:

<td class="valhisprofitVal"><%= Math.Round(profit, 5) %>%</td>

Then in jQuery, select the class:

$('.valhisprofitVal').hide();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜