I have the following code:
var inp = $(\"#txt\"); if(inp.val() != \"\") // do something
Is there any other way to check for empty textbox
Also You can use
$value = $("#txt").val(); if($value == "") { //Your Code Here } else { //Your code }
Try it. It work.
The check can be done like this:
if (!!inp.val()) { }
and even shorter:
if (inp.val()) { }