I want a script with a button that swaps text on another page(website)
so its a maintenance button when pressed on the administrator page it make text appear on the home page
what I've got
function myFunction() {
var x = document.getElementById("myDIV");
if (x.innerHTML === "Welcome!") {
x.innerHTML = "Sorry but this site is under Planed maintenance!";
} else {
x.innerHTML = "Welcome!";
}
}
<meta name="viewport" content="width=device-width, initial-scale=1">
<p><button onclick="myFunction()">Click Me</button></p>
<div id="myDIV">Welcome!</div>