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");
}
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");
}
Mis-spelling:
if(com.lenght <= 100){
use this:
if(com.length <= 100){