<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Ex 1</title>

      function doMagic() {
        // Confirm with user if they want to see magic
        let confirmMagic = prompt("Do you really want to see a magic? (y/n)");

        // Check if user wants to see magic or not
        if (confirmMagic == "y") {
          document.getElementById("magic").innerHTML = "Magic happened";
        } else {
          document.getElementById("magic").innerHTML =
            "sorry, we realy wanted to show some magic";

        // return statement is optional
    <button onclick="doMagic();">Do Magic</button>
    <p id="magic">Some magic is going to happen here</p>


Some magic is going to happen here

Have a Project?

Let us connect Today!