i am trying to get part of a string. when I do this:
var str = document.getElementById("textbox").value;
var str = str.substring(30, 35);
console.log(str)
it dosnt work, and I get this error:
TypeError: Cannot read property 'substring' of undefined at /script.js:2:15
but when I do this:
var str = "aunchoflettersandstuffthatisdefinetlystringandnotsomethingelseweird"
var str = str.substring(30, 35);
console.log(str)
it works, and I get this:
finet
in the console.
its not length of the text, I have tried that before.