1

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);
Ian
  • 3,605
  • 4
  • 31
  • 66

1 Answers1

1

You most likely need to use getComputedStyle:

console.log(window.getComputedStyle(test).backgroundPosition);
David Sherret
  • 101,669
  • 28
  • 188
  • 178