During AMC testing, the AoPS Wiki is in read-only mode and no edits can be made.

Difference between revisions of "AoPS Wiki:Sandbox"

(Aoum changed the content model of the page AoPS Wiki:Sandbox from "JavaScript" to "wikitext": Experiment)
(Tag: content model change)
Line 1: Line 1:
 
{{shortcut|[[A:SAND]]}} {{/header}} [[Category:AoPS Wiki]] <!-- Please do not delete this line -->
 
{{shortcut|[[A:SAND]]}} {{/header}} [[Category:AoPS Wiki]] <!-- Please do not delete this line -->
 
// 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);
 
};
 

Revision as of 18:22, 21 July 2025