<ul>
<li>
<div class="single-toggle">|Toggle|</div>
<div class="visible-when-folded">
<div class="name">Peter</div>
<div class="date">3 january 1984</div>
</div>
<div class="invisible-when-folded">
<div class="about">Funny guy</div>
<div class="contact_info">0879876745</div>
</div>
</li>
<li>
<div class="single-toggle">|Toggle|</div>
<div class="visible-when-folded">
<div class="name">David</div>
<div class="date">17 April 1988</div>
</div>
<div class="invisible-when-folded">
<div class="about">Jackass</div>
<div class="contact_info">0979876345</div>
</div>
</li>
</ul>
期望的结果
当我点击|Toggle|
元素时,只有里面的元素div.invisible-when-folded
会在相应的元素中消失li
。
我试过的
|Toggle|
在此代码中单击会同时切换两个li
元素的 div 不可见/可见。我如何让它只li
切换我点击的切换?