jquery function val() is not equivalent to "$(this).value="?
<p>When I try to set a text input to blank (when clicked) using <code>$(this).value=""</code>, this does not work. I have to use <code>$(this).val('')</code>.</p>

<p>Why? What is the difference? What is the mechanism behind the <code>val</code> function in jQuery?</p>

<pre><code>$(document).ready(function() {
    $('#user_name').focus(function(){
        $(this).val('');
    });
});
// error code: not working...
$(document).ready(function() {
    $('#user_name').focus(function(){
        $(this).value='';
    });
});
</code></pre>
