在用户关闭消耗性文本后,我试图让“减号”符号变回加号。
这是代码HTML
<p class="textDropTitle"><span class="textDropLogo"></span>Title</p>
<div class="textDropSub"><p>This is my text Below</div>
<p class="textDropTitle"><span class="textDropLogo">+</span>Title</p>
<div class="textDropSub"><p>This is my text Below</div>
<p class="textDropTitle"><span class="textDropLogo">+</span>Title</p>
<div class="textDropSub"><p>This is my text Below</div>
jQuery
$(".textDropSub").hide();
$('.textDropLogo', this).text('+');
$(".textDropTitle").click(function() {
$(this).next().toggle('fast');
$('.textDropLogo', this).text('-');
});