Menu
i see many examples of changing a css attribute in javascript like
document.getElementById(‘elementname’).style.color = ‘white’;
how can i get the value of the color of an element and assign it to a variable?
For example:
var tmpColor;
tmpColor = document.getElementById(‘elementname’).style.color;
or
tmpColor = document.getElementById(‘elementname’).style.backgroundColor
Thanks in advance for any suggestions.