I have an <iframe>
on my page.
Inside of the page, that is loaded in the iframe, is this: <span class="test">TEST</span>
I would like to change the color of TEST to red
.
This is what I wrote:
var test = document.querySelector("iframe").contentWindow.document.querySelector(".test");
test.style.color = "red";
Seems logical, but it doesn't work. – What's going on?