SyntaxFix
Write A Post
Hire A Developer
Questions
Simplest answer if your browser supports the trim() function
trim()
if (myString && !myString.trim()) { //First condition to check if string is not empty //Second condition checks if string contains just whitespace }