<script type ="text/javascript">
        $(document).ready(function() {
            $(".a").draggable({ helper: "clone" });//这是复制
            $("#b").droppable({
                accept: function(draggable) { return $(draggable).hasClass("a"); },//这里指定接受器接受的条件我这里批定了只要是类a就能放进来
                drop: function(draggable) {
                $(this).append($("<div ></div>").html("被拖进的id")//这里提示不知提何得到(用js不知如何得到)
                ); }            });
        });
    
    </script>

解决方案 »

  1.   

    你如何拖动的?能得到当前拖动的DIV的object吧
      

  2.   

    获得当前的object的话,你用
    当前object.id
    这样看看能显示没,如果确实得到的是当前的object,应该是可以得到ID的
      

  3.   

    看来没有,传来的是draggable
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>    <script src="../js/jquery.js" type="text/javascript"></script>    <script src="../js/ui/jquery.ui.all.js" type="text/javascript"></script>
        <script src="../js/ui/ui.draggable.js" type="text/javascript"></script>    <script src="../js/ui/ui.droppable.js" type="text/javascript"></script>
        <script type ="text/javascript">
            $(document).ready(function() {
                $(".a").draggable({ helper: "clone" });
                $("#b").droppable({
                    accept: function(draggable) { return $(draggable).hasClass("a"); },
                    drop: function(draggable) {
                    $(this).append($("<div ></div>").html($(draggable).html() + "l")//这里提示找不到不知提何得到
                    ); }            });
            });
        
        </script>
        <style type ="text/css">
        .a{border: 1px solid #CCC; width :100px; height :100px;cursor:hand;}
        #b{border: 1px solid #CCC; width :100px; height :100px;cursor:hand;}
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="a" id="a1" >
        红色
        </div>
        <div class="a" id="a2" >
        绿色
        </div>
        <div id="b">
        接受器
        </div>
        
        </form>
    </body>
    </html>
      

  4.   

    那你获取的应该不是当前移动DIV的OBJ?
      

  5.   

            $(document).ready(function() {
                $(".a").draggable({ helper: "clone" });
                $("#b").droppable({
                    accept: function(draggable) { return $(draggable).hasClass("a"); },
                    drop: function(draggable) {
                        (this).append($("<div ></div>").html(draggable.srcElement.id);
                    }});
            });
      

  6.   

    建议多看看 jQuery 的源码..