

~~~
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
<script>
$(function () {
var bBtn = true;
$('input').click(function () {
if(bBtn){
$('div').hide();// 隐藏
}else{
$('div').show();// 显示
}
bBtn = !bBtn;
})
})
</script>
</head>
<body>
<input type="button" value="点击">
<div>div</div>
</body>
</html>
~~~
***
#### 模拟点击菜单

~~~
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
ul{
display: none;
}
.box{
display: block;
}
</style>
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
<script>
$(function () {
$('input').click(function () {
$('ul').toggleClass('box');
})
})
</script>
</head>
<body>
<input type="button" value="点击">
<ul>
<li>1111</li>
<li>2222</li>
<li>3333</li>
<li>4444</li>
</ul>
</body>
</html>
~~~