title: JQuery UI .sortable('toArray') returning HTMLUListElement instead of array of id's
body: <p>I'm trying to create a sorted array out of my sortable elements but the 'toArray' method will not work. Here's my sortable html code:</p>
  
  <pre><code>&lt;div class="control-group" style="cursor:pointer;"&gt;
      &lt;label class="control-label" for="input-sort"&gt;Preferences&lt;/label&gt;
              &lt;div class="controls"&gt;
              &lt;ul id= "sortable"&gt;
                      &lt;li class="ui-state-default" id="Item1"&gt;&lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;Item 1&lt;/li&gt;
                      &lt;li class="ui-state-default" id="Item2"&gt;&lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;Item 2&lt;/li&gt;
                      &lt;li class="ui-state-default" id="Item3"&gt;&lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;Item 3&lt;/li&gt;
                      &lt;li class="ui-state-default" id="Item4"&gt;&lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;Item 4&lt;/li&gt;
                      &lt;li class="ui-state-default" id="Item5"&gt;&lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;Item 5&lt;/li&gt;
                      &lt;li class="ui-state-default" id="Item6"&gt;&lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;Item 6&lt;/li&gt;
                      &lt;li class="ui-state-default" id="Item7"&gt;&lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;Item 7&lt;/li&gt;
              &lt;/ul&gt;
              &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>and here's the corresponding javascript:</p>
  
  <pre><code>&lt;script&gt;
      var result=$("#sortable").sortable("toArray");
      $("#sortable").sortable({
          stop: function(event, ui) {
              document.getElementById("info").innerHTML=result + " and " + result[0];
          }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>When I display result it returns[object Object] and [object HTMLLIElement] and I even tried just assigning result to $("sortable li") but it didn't return any of the elements. 
  Any help is appreciated. Thanks.</p>