$(document).ready(function() {
$('#username').focus(function() {
$(this).val('');
})
$('#username').blur(function() {
var l = $(this).val.length;
if (l == 0) {
$(this).val('Username');
}
})
});
What the above code is supposed to do is empty the value of #username input field when focused and fill in the user friendly "Username" there when it loses focus in case it's still empty.
The second part doesn't work though (I think there is some problem with the if condition I'm using?).