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
  • 2,984
  • 3
  • 22
  • 52

1 Answers1

1

You most likely need to use getComputedStyle:

console.log(window.getComputedStyle(test).backgroundPosition);
David Sherret
  • 92,051
  • 24
  • 178
  • 169