JSFiddle - React, Tailwind, and code Playground

by Dale Howard

HTML

<p>Click the button to demonstrate the prompt box.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>

JavaScript

function myFunction() {
    var person = prompt("Please enter your name", "Harry Potter");
    if (person !== null) {
        document.getElementById("demo").innerHTML =
            "Hello " + person + "! How are you today?";
    }
}