title: How to add a validation error message next to a field using jQuery
body: <p>Hi have a form with a few fields. Amongst them:</p>
  
  <pre><code>&lt;div&gt;
      &lt;label for="phoneNumber" class="label"&gt;Phone Number&lt;/label&gt;
      &lt;input name="phoneNumber" type="text" id="phoneNumber" size="13"  style="float:left;margin-right:10px;"&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;input type="checkbox" name="activePN" id="activePN" checked &gt;
      &lt;label for="activePN"&gt;Active&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The, when the form is submited, I want to validate the input and write next to each field for whichever field didn't validate. Like this:</p>
  
  <pre><code>$('#submit').click(function () {
      var proceed = true;
      var strippedPN = $('#phoneNumber').val().replace(/[^\d\.]/g, '').toString(); //strips non-digits from the string
      if (strippedPN.length !== 10) {
          $('#phoneNumber').text('&lt;p&gt;Phone number has to be 10 digits long.&lt;/p&gt;')
          proceed = false;
      }
  ...
  ...
  ...
  });
  </code></pre>
  
  <p>I was hopping that adding those <code>&lt;p&gt; &lt;/p&gt;</code> tags would do it. But they don't...
  Note: I also tried with <code>html()</code> instead of <code>text()</code> and with <code>activePN</code> instead of <code>phoneNumber</code>.</p>