Javascript is working fine but not in jQuery
<p>This code works fine for me in Javascript.</p>

<pre><code>function check_u() {
    var errormessage = document.getElementById("errorname");
    var user = document.forms["login"]["user"].value;
    if (user == null || user == "") {
        errormessage.innerHTML = "Please enter your user id";
    } else {
        errormessage.innerHTML = "";
    }
}
function check_p() {
    var errormessage = document.getElementById("errorpass");
    var pass = document.forms["login"]["password"].value;
    if (pass == null || pass == "") {
        errorShow.innerHTML = "Password cannot be blank";
    } else {
        errorShow.innerHTML = "";
    }
}
</code></pre>

<p>My html is :</p>

<pre><code>&lt;input type="text" name="user" autocomplete="off" onBlur="check_u()" /&gt;
&lt;input type="text" name="password" autocomplete="off" onBlur="check_p()" /&gt;
&lt;div id="errorname" /&gt;
</code></pre>

<p>I have written an alternative for this code in jQuery. In JavaScript it works fine but in jQuery when I don't enter any input first time it is showing error message. I enter some value to it then it clears the error message. Now if I am leaving the input blank the error message doen't show up. Here is my jQuery code:</p>

<pre><code>function check_u(){
            var fieldValue = $("input[name=user]").val();
    if(fieldValue==""||fieldValue==null){
                    $("#errorname").html('&lt;div id = "error_left"&gt;&lt;/div&gt;'+
       '&lt;div id = "error_right"&gt;&lt;p&gt;This is a required field&lt;/p&gt;&lt;/div&gt;');
            }else{
                    $("#errorname").hide();
            }
        }
</code></pre>

<p>Why, if on repeated calls, does my errorname div not show up?</p>

<p>Does .hide() do more than just clear out the div?</p>
