【发布时间】:2013-01-23 22:44:10
【问题描述】:
我有以下 html
<div class="foo">
<a href="" class="bar1">Bar1</a>
<a href="" class="bar2">Bar2</a>
</div>
假设 .foo 默认隐藏,那么我只想显示 .foo 和他的孩子 .bar1。如何在 jquery 中做到这一点?
我的 jquery 中有这个
$('#' + id).children(".foo //anything I can do here to select ONLY bar1 to show? ").show();
【问题讨论】: