what i'm trying to do is to return the text that is contained by the moved li, after the list item was moved. Is there a way to do that? thanks
EDIT:
i tried: $(ui.item).text()
but i get an ui is not defined error
(i imported just jquery.js
, ui.core.js
and ui.sortable.js
, do i have to import something else?)
HTML
<ul id="sortable">
<li><a href="" class="drag">text</a></li>
<li><a href="" class="drag">another text</a></li>
<li><a href="" class="drag">more text</a></li>
</ul>
JS
$(document).ready(function(){
$('ul#sortable').sortable({
handle:'.drag',
axis:'y',
update:function(){
alert($(ui.item).text());
}
});
});