我只想在按下按钮时显示表单。这工作正常。当我再次单击该按钮时,我希望表单消失。有人可以解释问题是什么吗?谢谢!
<script type="text/javascript">
$(document).ready(function() {
$('#instantchannel').hide(); //Initially form wil be hidden.
var numclicks = 2
$('#instant').click(function() {
if(numclicks%2==1){
numclicks=++;
$('#instantchannel').show();//Form shows on button click
}else{
numclicks=++;
$('#instantchannel').hide();//Form shows on button click
}
});
});
</script>