JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<body>
<p>If you are a geek please press the button</p>
<button onclick="myFunction()">Here</button>
<p id="demo"></p>
<script>
function myFunction()
{
var x;
var r=confirm("You have been online for a year ! Do you want to log off and have a life ?");
if (r==true)
{
x="Go on and live your life ! ";
}
else
{
x="You Geek l!";
}
document.getElementById("demo").innerHTML=x;
}
</script>
<p>please enter your Name.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction()
{
var x;
var person=prompt("Please enter your name","Harry Potter");
if (person!=null)
{
x="Hello " + person + "! How are you today?";
document.getElementById("demo").innerHTML=x;
}
}
</script>
</body>
</html>