JavaScript Program to display an alert box

Program

<!DOCTYPE html>
<html>
<body>

<p>Click the button to display an alert box:</p>
<button onclick="myFunction()">Display Alert</button>

<script>
function myFunction() {
    alert("This is an alert box!!!");
}
</script>

</body>
</html>

Output

Click the button to display an alert box: