I have two web pages:
pageone.html and pagetwo.html
In pageone.html, there is a button with an id of change-color
When you click that button, the background color of pagetwo.html is supposed to turn green.
But that isn't happening.
Can someone help me?
function changeColor() {
//code
var pageTwo = 'pagetwo.html';
pageTwo.style.backgroundColor = "green";
}
<button type="button" id="change-color" onclick="changeColor">Change Background Color</button>
windowfocus event