[Solved] Click a button in two pages at once
Out of Curiosity i just tried MartinWebb’s answer. I hope it might give you a start. Page # 1: <button type=”button” onclick=”hello()”>Hello</button> <script type=”text/javascript”> // window.localStorage.removeItem(“text”); function hello() { window.localStorage.setItem(“text”,”Hello there..”); } </script> Page # 2: <p id=”show”></p> <script type=”text/javascript”> window.addEventListener(‘storage’, storage_event_listener, false); function storage_event_listener(evt) { document.getElementById(“show”).innerText = evt.newValue; // console.log(evt); } </script> You can … Read more