JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" name="submit" value="showtime" onclick="show_confirm()"/>

JavaScript

function show_confirm() {
    var r = confirm("Press the button");
    if (r == true) {
        alert("You are right");
    } else {
        alert("You are wrong");
    }
}