AoPS Wiki:Sandbox

Revision as of 19:17, 21 July 2025 by Aoum (talk | contribs) (Aoum changed the content model of the page AoPS Wiki:Sandbox from "JavaScript" to "wikitext": Experiment)
Shortcut:

L Edit this page

This Sandbox page is for experimenting with AoPS Wiki editing.

Feel free to test formatting, links, or templates here. If you're new, you may find the AoPS Wiki editing tutorial helpful.

Note: This page is cleared regularly and without warning. Please do not add offensive, copyrighted, or inappropriate content.

// Display an alert when the page loads window.onload = function() {

   alert("Page content has loaded!");
   
   // Change the content of a specific element with ID 'example'
   var element = document.getElementById("example");
   if (element) {
       element.innerHTML = "This is dynamically updated content!";
   }
   
   // Add a new button to the page dynamically
   var newButton = document.createElement("button");
   newButton.innerHTML = "Click Me!";
   newButton.onclick = function() {
       alert("Button clicked!");
   };
   document.body.appendChild(newButton);

};