title: How to use multiple input field class name in jquery for validation
body: <p>Suppose I have a form of two input field</p>
  
  <pre><code>&lt;input type="text" name="form-first-name" placeholder="name" class="form-first-name form-control require" id="name"&gt;
  &lt;input type="text" name="form-age" placeholder="age" class="form-first-name form-control require" id="age"&gt;
  </code></pre>
  
  <p>Now I want to validate these two input fields sing jquery. For that I am using</p>
  
  <pre><code>$('.registration-form input[class="require"]).on('focus', function() {
      $(this).addClass('input-error');
  });
  </code></pre>
  
  <p>But here is not validation working. But if I have use </p>
  
  <pre><code>$('.registration-form input[id="name"]).on('focus', function() {
      $(this).addClass('input-error');
  });
  </code></pre>
  
  <p>Validation is working fine. </p>
  
  <p>But I want to use <code>class</code> otherwise I need to validate the for input fields for each <code>id</code>. If I can use <code>class</code> it will be easier for me to validate.</p>