title: getElementsByName on jQuery
body: <p>When I select an element by name in Javascript, I usually use this code:</p>
  
  <pre><code>document.GetElementsByName('pencil')[0]
  </code></pre>
  
  <p>This way, it gets the first element by the name "pencil" and, if I want to get the second, third, etc. I just change the zero with one, and so on.</p>
  
  <p>Now I am trying to do this in jQuery, by using this selector:</p>
  
  <pre><code>$('div[name|="pencil"]')
  </code></pre>
  
  <p>obviously this will be an array of divs named "pencil".</p>
  
  <p>How can I make it refer to a particular name as I do with plain javascript? Thank you.</p>
  
  <hr>
  
  <p>I am trying to get its innerHTML by using this code:</p>
  
  <pre><code>alert( $('div[name|="ball"]').html()
  </code></pre>