<div>
<p>yoyo1</p>
<p>yoyo2</p>
<p>yoyo3</p>
<p>yoyo4</p>
</div>
<div id="div1">div1
<div id="div2">div2
<div id="div3">div3</div></div></div>
<div id="testhover">youzhu</div>
<div id="testtoggle">youzhu</div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
$(function() {
$("p").live("click", function() {
$(this).after("<p>Another paragraph!</p>");
})
$("#div1").click(function() {
alert("div1");
});
$("#div2").click(function() {
alert("div2");
});
$("#div3").click(function(e) {
//debugger;
e.stopPropagation();
alert("div3");
});
$("#testhover").hover(
function() {
$(this).css({ background: "blue" });
},
function() {
$(this).css({ background: "green" });
});
$("#testtoggle").toggle(
function() {
$(this).css({ background: "blue" });
},
function() {
$(this).css({ background: "green" });
},
function() {
$(this).css({ background: "black" });
});
$("#TextBox1").blur(function() {
alert("焦点已移开");
});
});