hide() function doesn't work in jQuery
<p>I am having problems with jQuery validation of a form.</p>

<p>This is my javascript file: test.js.</p>

<pre><code>$(function() {
$('.error').hide();
    $(".button").click(function() {
        $('.error').hide();
  var name = $("input#name").val();
    if (name == "") {
    $("label#name_error").show();
    $("input#name").focus();
    return false;
  }
});
});
</code></pre>

<p>This is my html file.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="test.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="jquery-1.5.2.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="contact_form"&gt;
&lt;form name="contact" action=""&gt;
  &lt;label for="name" id="name_label"&gt;Name&lt;/label&gt;
  &lt;input type="text" name="name" id="name" size="30" value="" class="text-input" /&gt;
  &lt;label class="error" for="name" id="name_error"&gt;This field is required.&lt;/label&gt;
&lt;/form&gt; 
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I placed these two files together with the jQuery file in the same directory on my server, but the content "This field is required." is still visible. It seems like hide() function in the test.js doesn't work. Can anyone point me out where is wrong? Great thanks!</p>
