<div class="catListComment">
<div class="divRecentCommentAticle"></div>
<div class="divRecentCommentAticle"></div>
</div> 如何追加成这样 <div class="catListComment">
<div class="divRecentCommentAticle"></div>
<div class="divRecentCommentAticle"></div>
</div>
<div class=box-bottom>123</div> $(".catListComment").after('<div class=box-bottom>123</div>'); 这样不行的? 

解决方案 »

  1.   

    你这个是jQuery吧
    $(".catListComment").after('<div class="box-bottom">123</div>');在语法上没有问题啊~难道你运行不行?
      

  2.   

    JQ不会,请问楼主上面的代码把DIV添加到哪里了?
      

  3.   

    加到<div class="catListComment"></div>后面
    不是里面
      

  4.   


    是jquery  运行不出来?不知道为什么了
      

  5.   

    LZ发下你的全部HTML来看看OK?
      

  6.   

    <!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=utf-8" />
    <title>无标题文档</title>
    <SCRIPT type="text/javascript" src="jquery.js"></SCRIPT>
    <SCRIPT type="text/javascript">  
    (function(){$(".catListComment").after('<div class=box-bottom>123</div>');
    alert($(".catListComment"));
     })(jQuery); </SCRIPT>
    </head><body><div class="catListComment">
    <div class="divRecentCommentAticle">12</div>
    <div class="divRecentCommentAticle">3</div>
    </div></body>
    </html>
      

  7.   


    <!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=utf-8" />
    <title>无标题文档</title>
    <SCRIPT type="text/javascript" src="js/jquery-1.4.2.min.js"></SCRIPT></head><body><div class="catListComment">
    <div class="divRecentCommentAticle">12</div>
    <div class="divRecentCommentAticle">3</div>
    </div>
    <SCRIPT type="text/javascript">  
    (function(){
    alert($(".catListComment").html());
    $(".catListComment").after('<div class=box-bottom>123</div>');
    alert($(".catListComment").html());
     })
    (jQuery); </SCRIPT>
    </body>
    </html>
      

  8.   

    .catListComment都没加载。
    和谈操作。你的jquery语句是没有问题的。
      

  9.   

    <!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=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
    <SCRIPT type="text/javascript">  
    $(document).ready(function(){
    $(".catListComment").after('<div class=box-bottom>123</div>');
    alert($(".catListComment"));
     }); </SCRIPT>
    </head><body><div class="catListComment">
    <div class="divRecentCommentAticle">12</div>
    <div class="divRecentCommentAticle">3</div>
    </div></body>
    </html>