如果加一个参数“slow”则会减慢隐藏的速度。hide("slow")
$("<p>This is another paragraph.</p>
");
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.11111</p>
<button>Click me</button>
</body>
这个页面是jquery学校 $(document).ready(...);表示页面加载的时候就执行...的方法, 这是为了防止文档在完全加载(就绪)之前运行 jQuery 代码。