I have a simple form that I want to validate using blur if the text field is empty.
The below code should work, but keeps alerting me even if I pop in some text, please, what am I doing wrong?
var name = $("input#name").val();
$("input#name").blur(function()
{
if (('input#name:empty'))
{
// Testing
alert('Empty');
}
});