title: Custom Validity JQuery
body: <p>I have found tutorials which showing how to use javascript to set custom errors for a form's input fields. An example is as follows:</p>
  
  <pre><code>  document.getElementById('fname').setCustomValidity('Invalid'); 
  </code></pre>
  
  <p>However if i try to use jquery this does not seem to work. An example is as follows:</p>
  
  <pre><code>$('#fname').setCustomValidity('Invalid');
  </code></pre>
  
  <p>I prefer working with JQuery so can anyone tell me why this does not work and how i can possibly do the same in JQuery.</p>