jquery實現點擊隱藏,再點擊原按鈕恢復

<html>
<head>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs
/jquery/1.4.0/jquery.min.js"></script>
</head>

</script>
<script type="text/javascript">
$(document).ready(function(){
$("#hide").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>
<p id="p1"> if you click on me ,i will disappear.</p>
<button type="button" id="hide">hide</button>
</body>
</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章