I have the following code:
var inp = $(\"#txt\"); if(inp.val() != \"\") // do something
Is there any other way to check for empty textbox
The check can be done like this:
if (!!inp.val()) { }
and even shorter:
if (inp.val()) { }