<html>
<head>
<script type=\”text/javascript\” src=\”/jquery/jquery.js\”></script>
<script type=\”text/javascript\”>
$(document).ready(function(){
$(\”.btn1\”).click(function(){
$(\”p\”).toggle();
});
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<button class=\”btn1\”>Toggle</button>
</body>
</html>
jQuery – toggle() 切换 显示与隐藏
未经允许不得转载:爱站程序员基地 » jQuery – toggle() 切换 显示与隐藏