Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
44
rated 0 times [  45] [ 1]  / answers: 1 / hits: 27339  / 15 Years ago, fri, february 5, 2010, 12:00:00

I want to check the size of the string entered in a text box.
what am I missing?



var com = document.getElementById(comment).value;
if(com.lenght <= 100){
alert(good);
} else {
alert(bad);
}

More From » javascript

 Answers
7

Try changing lenght to length.


[#97652] Wednesday, February 3, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skylerselenem

Total Points: 282
Total Questions: 101
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
4 Years ago
;