I'm trying to get the simple hex code value of the test
div. I've followed the exact same principle as with this post, although I'm not getting it. What should be logged into the console is the hex code #0ff0ff
var test = document.getElementById('test'),
window.getComputedStyle(test);
console.log(style.getPropertyValue('background'));
#test {
background: #0ff0ff;
}
<div id='test'>test</div>
Any ideas where I'm going wrong? Thanks for any help here