title: jQuery validation - How to apply display none and block to error parent elemnt
body: <p>I am playing with jQuery validation first time and facing some issue so I need some help. I have bellow HTML and jQuery code.</p>
  
  <pre><code>&lt;form id="form" method="post" action="#"&gt;
      &lt;ul&gt;
          &lt;li&gt;
              &lt;input type="text" name="autocomplete" id="autocomplete" value="" class="sale-tex-bx" placeholder="Address e.g.21 Spring Street, New York, USA" /&gt;
              &lt;span id="autocompleteError" class="requ" style="display: none;"&gt;&lt;/span&gt; 
          &lt;/li&gt;
          &lt;input type="submit" /&gt;
      &lt;/ul&gt;
  &lt;/form&gt;
  
  &lt;script type='text/javascript'&gt;//&lt;![CDATA[ 
  $(document).ready(function () {
  
      $("#form").validate({
          rules: {
              "autocomplete": {
                  required: true
              }
          },
          messages: {
              "autocomplete": {
                  required: "Required"
              }
          },
          errorPlacement: function (error, element) {
  
              if (element.attr("name") == "autocomplete") {
                  jQuery('#autocompleteError').show();
                  error.appendTo('#autocompleteError');
              }
  
          },
          submitHandler: function (form) { // for demo
              jQuery('#autocompleteError').hide();
              alert('valid form submitted'); // for demo
              return false; // for demo
          }
      });
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>My fiddle is: <a href="http://jsfiddle.net/NP8sS/804/" rel="nofollow">http://jsfiddle.net/NP8sS/804/</a></p>
  
  <p>When you validate the form you can see If error display, jQuery validation is adding <code>style="display: inline;"</code> to the label element and If form is valid label inline style changed to <code>display: none</code>.</p>
  
  <p>Now I want to same thing to his parent span, in my example which is this: <code>&lt;span id="autocompleteError" class="requ" style=""&gt;</code> </p>
  
  <p>Any Idea how to implement this jQuery?</p>
  
  <p>Thanks.</p>