i used the String.length(string) function in javascript to get the length of string but nothing happened. It doesn't give me a value when i tried to view the result using an alert function. Actually, this kind of problem does not only exist with the length function, it's also the same with the trim(). I have not tried using other functions but perhaps it won't also work. What could be the possible reason for this?

have you tried

text='abchefgh';
alert(text.length);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.