views:

25

answers:

2

Hi,

I have the following code

<div id="container">
    <div id="_01">1° item</div>
    <div id="_02">2° item</div>
    <div id="_03">3° item</div>
    <div id="_04">4° item</div>
</div>

So in my js code

$("#container div").draggable({
    stop:function(e, ui) {

    }});

What i have to put in stop event in order to get the identifier of a draggable element ?

regards,

A: 

Have you tried:

$(this)  // this should be the current element
Nick Berardi
+1  A: 
$("#container div").draggable({
    stop:function(e, ui) {
       alert("id=" + $(this).attr("id");
    }});
Philippe Leybaert