title: Unable to select all elements using jQuery class selector
body: <p>Here iam having a table data in which 3 input items which are having a common class <strong>submit3</strong>.Whenever i want to select the 3 buttons using jQuery and want to change the value and name attributes of these elements to some other text.</p>
  
  <p>Here iam including the code snippet of the data</p>
  
  <pre><code>&lt;td colspan=2&gt;
  
      &lt;input type="submit" value="Login" class="submit3" onclick="return checknull()" tabindex="1"&gt;
  
      &lt;input type="button" value="Reset" class="submit3" onclick="call_reset()" tabindex="1"&gt;
  
      &lt;input type="button" value="Forgot Password ?" class="submit3" onclick="call_fgpwd()" tabindex="1"&gt;
  
  &lt;/td&gt;
  </code></pre>
  
  <p>But when iam selecting with jquery using the class selector $('.submit3') it only returning the first input submit button and it is ignoring the remaining 2.</p>
  
  <p>Here original javascript is here</p>
  
  <pre><code>document.getElementsByClassName("submit3")[0].value = "something";
  document.getElementsByClassName("submit3")[1].name = "something";
  document.getElementsByClassName("submit3")[2].name = "something";
  document.getElementsByClassName("submit3")[2].value = "something";
  </code></pre>
  
  <p>Now i tried converting it into jquery as </p>
  
  <pre><code>$('.submit3')[0].val("Something New")
  </code></pre>
  
  <p>Which resulted in error  <code>Uncaught TypeError: $(...)[0].val is not a function</code></p>
  
  <p>Also in the console of chrome browser(Latest Version),when i run $('submit3')
  the output is 
  <code>&lt;input type="submit" value="Login" class="submit3" onclick="return checknull()" tabindex="1"&gt;</code>
  <a href="https://i.stack.imgur.com/XbL1a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XbL1a.png" alt="enter image description here"></a></p>