I have an input that I want to validate:
<input type="text" id="input" /> And here's the JS:
jQuery("#input").live('change', function() { if("#input:not(:empty)") { alert('not empty'); } else if("#input:empty") { alert('empty'); } }); Even when the "#input" is empty there's no way of displaying alert with "empty" message. So, basically, no matter what I do, only the first statement is true and the second is false, always.
What's wrong?