<a href="#" id="link">Link</a>
<div id="example">
Content
</div>
点击#link
触发.hide()
为#example
现在我想#link
触发.show()
为#example
我知道这是很基本的,但我似乎无法到找到它。提前致谢。在第一功能之后。单击新的功能在jQuery的完成
<a href="#" id="link">Link</a>
<div id="example">
Content
</div>
点击#link
触发.hide()
为#example
现在我想#link
触发.show()
为#example
我知道这是很基本的,但我似乎无法到找到它。提前致谢。在第一功能之后。单击新的功能在jQuery的完成
要使用toggle
$('#link').click(function() {
$('#example').toggle();
});
尝试:
$("#link").click(function(){$("#example").toggle()});
你知道〜〜这是不行的。 –