3
Because the code below only returns me the first "104 104" and not "104 106"
$(function(){
$('#sortable li').each(function(){
console.log($('#sortable li').attr('id'));
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<ul id="sortable">
<li id="104"></li>
<li id="106"></li>
</ul>
Can you join HTML? so we can respond more pedagogically. Briefly you are always using the same element... you should use
console.log(this.id);
. But if you join HTML it’s easier to understand the problem and answer.– Sergio