I got the error "Cannot read property 'style' of null" and I tried everything I put the script in the bottom of the HTML and I still got the error. what do I do?
Line with error:
document.getElementById("span").style.webkitTransform = v
"rotate"+p+"("+ps.value+"deg)"
function r(p) {
var ps;
ps = document.getElementById(p);
document.getElementById("span").style.webkitTransform = "rotate" + p + "(" + ps.value + "deg)"
}
<div class="box">
<div class="div">
<span class="span"></span>
</div>
</div>
X:<input type="range" id="X" onchange="r('X');" value="45" /> Y:
<input type="range" id="Y" onchange="r('Y')" /> Z:
<input type="range" id="Z" onchange="r('Z')" />