JSFiddle - React, Tailwind, and code Playground

HTML

<main>
    <section>
        	<h3>This button will present you with an addition challenge. It will present you with a random number between 1 and 100 and ask you to supply two numbers which, when added together, equal that random number. You will have three chances to answer correctly.</h3>

        <button type="button" id="challengeButton">Begin</button>
        	<h3>This button will unleash ABSOLUTE POWER! . . . by which I mean it will prompt you for two pairs of numbers, in which the first number is the root and the second is the power to which you will raise it. The result of the second pair shall be subtracted from the result of the first, then the absolute value of this result will be ascertained and displayed. You will then be asked for which of this value's roots you'd like to take. Note that each value must be between 1 and 10.</h3>

        <button type="button" id="absolutePower">Begin</button>
    </section>
</main>

JavaScript

function beginAdditionChallenge() {
    var x = Math.ceil(Math.random() * 100);
    alert(x);
    for (var i = 0; i < 3; i++) {
        var a = Number(prompt("Provide the first addend.", ""));
        var b = Number(prompt("Provide the second addend.", ""));
        if (a + b === x) {
            alert("Well done!");
            break;
        } else if (a + b !== x && i < 2) {
            alert("Please try again.");
        } else {
            alert("Derp.");
        }
    }
}

function initChallenge() {
    var button = document.getElementById("challengeButton");
    button.addEventListener("click", beginAdditionChallenge);
}

window.addEventListener("load", initChallenge);