Alex Rivera | Logout

How to check if a text is all white space characters in client side?

Asked 2009-07-23T14:35:53.743
70

How to check if a user input text is all white space characters (space, tab, enter etc) in client side?

Edit
Report

1 Answer

32

This will also work:

var text = "   ";
text.trim().length == 0; //true
answered 2012-07-19T17:24:04.450

Your Answer