SyntaxFix
Write A Post
Hire A Developer
Questions
var inp = $("#txt").val(); if(jQuery.trim(inp).length > 0) { //do something }
Removes white space before checking. If the user entered only spaces then this will still work.