title: How to return HtmlCollection from Jquery selection
body: <p>I have a jquery selection like this:</p>
  
  <pre><code>elements= $($('#mytab').find('form').attr('elements')).not('button');
  
  // access elements by name
   elements['id']=1;
  </code></pre>
  
  <p>which is not working obviously :(</p>
  
  <p>I need the jquery to return the collection as HtmlCollection e.g</p>
  
  <pre><code>$('#mytab').find('form').attr('elements')
  </code></pre>
  
  <p>My qeuestion is, is there any function available e.g like toArray() etc to 
  return the collection as HtmlCollection, instead of jquery array/ object collection ?
  My main objective is to access form elements by name not by index e.g</p>
  
  <pre><code>elements['id'], elements['name']
  </code></pre>
  
  <p><a href="https://developer.mozilla.org/en-US/docs/DOM/form.elements" rel="nofollow">Html Form elements</a>
   Lots of confusion around elements. elements is attribute of html <code>form</code> object which is collection of all the elements in the <code>form</code></p>
  
  <p><a href="http://jsfiddle.net/AfMst/" rel="nofollow">Here is a JSfiddle for this.</a></p>