切换时锚的文本没有变化,请给我一些建议
html:
<a href="#" onclick="javascript:showHide('flight_<?php echo $flightlist->id ?>'); class="fnt-size12">+Flight Details</a>
<div id="flight_<?php echo $flightlist->id; ?>" class="minDetailBox addmarginB10 borT">
<div class="col1">
<div class="padding">
<div class="airLogo"> <span class="airSprites LS2"> </span>
<p>JET Lite</p>
</div>
</div>
</div>
</div>
脚本:
function showHide(id) {
var minDetails = document.getElementById(id);
$(minDetails).toggle('slow');
($(this).text() === "+Flight Details") ? $(this).text("-Flight Details") : $(this).text("+Flight Details");
return false;
}