title: jQuery add required to input fields
body: <p>I have been searching ways to have jQuery automatically write required using html5 validation to my all of my input fields but I am having trouble telling it where to write it.</p>
  
  <p>I want to take this</p>
  
  <pre><code> &lt;input type="text" name="first_name" value="" id="freeform_first_name"
   maxlength="150"&gt;
  </code></pre>
  
  <p>and have it automatically add <strong>required</strong> before the closing tag</p>
  
  <pre><code> &lt;input type="text" name="first_name" value="" id="freeform_first_name"
   maxlength="150" required&gt;
  </code></pre>
  
  <p>I thought I  could do someting along the lines of </p>
  
  <pre><code>$("input").attr("required", "true");
  </code></pre>
  
  <p>But it doesn't work. Any help is greatly appreciated. </p>