getElementById
Posted: Thu Aug 13, 2009 10:58 am
I've been working on a very small script, 2 lines to be exact but it refuses to work, i've browsed the internet for tutorials on this and according to them what i'm doing is correct but it doesn't work. I'm a total newbie when it comes to Javascript.
When i switch getElementById to something like (var str="12345"; alert(str.length);) it works fine.
Code: Select all
function stringlen(){
var str=document.getElementById("story");
alert(str.length);
}