jquery
<div class="block_comments"> <div class="comment"> <div class="userpic"><a href="#"><img src="images/ava_default_1.jpg" alt="" /></a></div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为人们要感恩的人哟很多法撒旦法涉及多方考虑斯达康减肥就算了打开解放累进税率大幅速卡戴假发就算了打开房间速率可达飞机螺丝钉棵发了看似简单</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth"></div> <div class="line_3"></div> </div> <div class="comment"> <div class="userpic"><a href="#"><img src="images/ava_default_1.jpg" alt="" /></a></div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为人们要感恩的人哟很多法撒旦法涉及多方考虑斯达康减肥就算了打开解放累进税率大幅速卡戴假发就算了打开房间速率可达飞机螺丝钉棵发了看似简单</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth"></div> <div class="line_3"></div> </div> <div class="comment"> <div class="userpic"><a href="#"><img src="images/ava_default_1.jpg" alt="" /></a></div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为人们要感恩的人哟很多法撒旦法涉及多方考虑斯达康减肥就算了打开解放累进税率大幅速卡戴假发就算了打开房间速率可达飞机螺丝钉棵发了看似简单</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth"></div> <div class="line_3"></div> </div> </div>
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /><script type = "text/javascript" src = "js/jquery.js"></script><title>无标题文档</title><style type = "text/css"></style></head><script>$(function(){ $(".control").click(function(){ $("div.insertDiv").remove(); $(this).parents().next(".clearboth").before("<div class= 'insertDiv'>charuchenggong</div>"); return false; });});</script><body><div> <div> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我</p> <p class="info"><a href="#none" class="control" id="rep" >回复</a> </p> </div> <div class="clearboth">sdf</div> <div class="line_3">sd</div> </div> <div class="comment"> <div class="content"> <p class="name"><a href="#">路人甲</a></p> <p class="text">我认为</p> <p class="info"><a href="#none" class="control" id="rep1" >回复</a> </p> </div> <!--点击回复后这里加上一个div--> <div class="clearboth">435</div> <div class="line_3">345</div> </div></div></body></html>