<div id="divMsg">Hello World!</div>
<input id="btnShow" type="button" value="显示" />
<input id="btnHide" type="button" value="隐藏" /><br />
<input id="btnChange" type="button" value="修改内容为 Hello World, too!" />
<script type="text/javascript" >
//以上有三个按钮, 分别用来控制Hello World的显示, 隐藏和修改其内容
//bind() 事件绑定函数 show()和hide()显示和隐藏函数
//$("#btnShow").click(function(event){$("#divMsg").show(); });
//或者
$("#btnShow").bind("click", function(event){ $("#divMsg").show(); });
//$("#btnHide").click(function(event){$("#divMsg").hide()});
//或者
$("#btnHide").bind("click", function(event){$("#divMsg").hide(); });
//$("#btnChange").click(function(event){$("#divMsg").html("hello world to to!");});
//或者
$("#btnChange").bind("click", function(event){$("#divMsg").html("hello world to to!");});
</script>