当clone遇到before
$(".red").after($(".red").clone());可以,$(".red").before($(".rad").clone());咋不行?
$(".red").after($(".red").clone());可以,$(".red").before($(".rad").clone());咋不行?
2016-04-28
我自己测试了一下。可以的啊。你怎么不行?贴个代码。。你去试试。。我测试了是可以。
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>挑战题</title>
        <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
    </head>    
    <body>        
        <button class="g">点我加载逗逗相关</button>
        <script>
        $(function(){
            $(".g").bind("click",function(){
                //$(this).after($(this).clone());    
                $(this).before($(this).clone());
            })            
        })            
        </script>
    </body>
</html>
举报