I am using jQuery sortable to allow users to move elements around on a page. Each div element has a unique ID. When the user swaps an element on the page with another I want to also swap those element ID's and alert the new list of ID's order, So I can save this new order to the backend. 

I am struggling to get the child element ID's for when the user moves an element. My jQuery so far is:

```
  $(function() {
    $("#sortable").sortable({
      stop: function(ev, ui) {
        var children = $('#sortable').sortable('refreshPositions').children();
        alert('Positions: ');
        $.each(children, function() {
            alert($(this).attr('id'));
        });
      }
    });
    $("#sortable").disableSelection();
    var drag_id = $('.container').attr("id");
  });

```

but the alert message is always `undefined`. How do I swap the div ID's when the user makes a change and save this to an array and then `alert` this array?

[FIDDLE](https://jsfiddle.net/kevinabraham/7rbv20yd/4/)