这是我想要展开/折叠的列表: 我的目标只是切换展开/折叠,让这个列表像手风琴一样。我不明白的是如何使用下面提供的 javascript 将 <div> 从隐藏状态变为可见状态。非常感谢任何资源或直接帮助。
船运
<li class="plusimageapply"><a name="faq-question">Why do I see prices for some items and not others? How do I get pricing on items that I want to buy?</a></li>
<div style="display: none;">Ths is a sampel of an answer tot he above question.</div>
<li class="plusimageapply"><a name="faq-question">How do I handle an overnight delivery?</a></li>
<div style="display: none;">AMOeasy offers five overnight shipping options. During checkout, simply check the option that best meets your needs and process your order.
<ul>
<li>UPS orders must be placed before 5:30pm EST / 2:30pm PST.</li>
<li>FedEx orders must be place before 8:00pm EST / 5:00pm PST.</li>
</ul>
If you are concerned that the item may not be in stock, please call customer service at 877-AMO-4LIFE (877-266-4543).
</div>
以下是我正在使用的 JavaScript
<script type="text/javascript">
$(document).ready(function(){
$('li a').click(function () {
var questionname= this.name;
$("#"+questionname).toggle();
$(this).parent().toggleClass("minusimageapply");
});
});
</script>