How can one print out a particular style in the console?
This is my current (failed) attempt.
var test = document.getElementById("moop");
console.log(test.style.backgroundPostion);
How can one print out a particular style in the console?
This is my current (failed) attempt.
var test = document.getElementById("moop");
console.log(test.style.backgroundPostion);
You most likely need to use getComputedStyle
:
console.log(window.getComputedStyle(test).backgroundPosition);