开发者

Troubleshooting ui.item in jQuery

I'm currently using the jQuery sortable plugin and one of the things I can do is on change I can run a function:

$( "#listA, #listB" ).sortable({
    connectWith: ".connected_sortable",
    delay: 100,
    receive: function(event, ui) {
                alert(ui.item.text());
            }
}).disableSelection();

In this case I'm using an alert. How do I figure 开发者_JAVA百科out what objects are in the ui.item? text() currently gives me the text I've used in the but how do I find out all of the other information? More specifically the id? I couldn't find information on this in the jQuery Documentation. Is there a way to use Firebug to find out what functionality ui.item has?

Thank you!


console.log("%o", ui.item);

or set a breakpoint inside the function with firebug, then right click the ui and 'inspect in dom'.


You could also use

ui.item.attr("id");

ui is a normal jQuery wrapped element

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜