I have <img id="token" src="/files/images/token.png" />
that I'm attempting to change opacity with window.onload if $tokens value is 0. the $tokens value does read correctly and displays below the image with how many there are. this is my script:
<script>
window.onload=function(){
if($tokens == '0'){
var ntoken= document.getElementById("token");
ntoken.style.opacity='0.4';
ntoken.style.filter='alpha(opacity=40)';
}
}
</script>
did I forget something?