I have the following code:
var inp = $("#txt"); if(inp.val() != "") // do something
Is there any other way to check for empty textbox using the variable 'inp'
if (inp.val().length > 0) { // do something }
if you want anything more complicated, consider regex or use the validation plugin which takes care of this for you
1.4m articles
1.4m replys
5 comments
57.0k users