<span style="font-size:14px;"><!DOCTYPE html>
<html>
<head>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("div").on("click","#one",function(){
;
$("#one").remove();//或者$(this).remove();
var two="<p id='two' >The paragraph was clicked.</p>";
$("div").append(two);
});
$("div").on("click","#two",function(){
$("#two").remove();
var one="<p id='one' >Click this paragraph.</p>";
$("div").append(one);
});
});
</script>
</head>
<body>
<div>
<p id="one">Click this paragraph.</p>
</div>
</body>
</html>
</span>
这是我自己写的一个例子
你也可以看jquery菜鸟教程的例子
链接:http://www.runoob.com/try/try.php?filename=tryjquery_event_on_newel