This error message means that you accessed the property “all” of the variable document
, but this property is, let’s say, deprecated, so should not be used. The console says that you should use a method “getElementById”, which returns the element with given id, on which you can then proceed.
To access the element by id if you know the id, you can for example, declare a variable and assign to it the result of getElementById
(there is going to be a problem with style[property]
):
var myElement=document.getElementById("id");
return myElement.property; // height for example
or just
return document.getElementById("id").property; // height for example
solved Tree view using javascript and css