I now have a button that displays hidden content when clicked. This can be achieved with toggle, but how can I not separately determine whether the content is hidden, but directly replace the value in the button while displaying the hidden content in toggle? Between " " and " -" to switch between.
<input type="button" value="-" class="hsBtn">
$(".hsBtn").live("click",function(){
$(target).toggle();
})
女神的闺蜜爱上我2017-06-12 09:34:25
<input type="button" value="-" class="hsBtn">
$(".hsBtn").live("click",function(){
var $this=$(this),
val=$this.val();
$this.val(val=='-'?'+':'-')
$(target).toggle();
})
PHP中文网2017-06-12 09:34:25
Then determine whether the content to be displayed is in the display state. If so, it is -, otherwise it is +