I have the following code:
var inp = $(\"#txt\"); if(inp.val() != \"\") // do something
Is there any other way to check for empty textbox
if ( $("#txt").val().length == 0 ) { // do something }
I had to add in the == to get it to work for me, otherwise it ignored the condition even with empty text input. May help someone.