SyntaxFix
Write A Post
Hire A Developer
Questions
First convert it to a string:
var mynumber = 123; alert((""+mynumber).length);
Adding an empty string to it will implicitly cause mynumber to turn into a string.
mynumber