I have the following code below which I am trying to set the background color. However, the background color is returned as an empty string. I'm not sure why ... Does this have anything to do with JavaScript types?
function function1(){ var color = document.getElementById('rg_vw.national_avg').style.backgroundColor;
As a health check, if I use the value property, it outputs the correct value for this particular field ... so I'm a little upset as to why backgroundColor is an empty string.
//this works just fine var value = document.getElementById('rg_vw.national_avg').value alert(value)
source share