有2个div,a和b,当点击a时b隐藏,再次点击b显示
<!DOCTYPE HTML>
<html>
<head>
<title>yugi</title>
<meta charset=UTF-8 />
<style type="text/css">
</style>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
jQuery (function ($)
{
$ ("#a").click (function ()
{
$ ("#b").toggle();
});
})
</script>
</head>
<body>
<div id="a">aaaa</div>
<div id="b">bbb</div>
</body>
</html>
<html>
<head>
<title>yugi</title>
<meta charset=UTF-8 />
<style type="text/css">
</style>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
jQuery (function ($)
{
$ ("#a").click (function ()
{
$ ("#b").toggle();
});
})
</script>
</head>
<body>
<div id="a">aaaa</div>
<div id="b">bbb</div>
</body>
</html>
温馨提示:答案为网友推荐,仅供参考