Javascript - Popup Boxes

Now you all are getting basic knowledge of JavaScript Syntax, how to use and how to embed with Html so let’s be yourself ready to fly with dynamism of JavaScript.

When we want something highlighted, prompted or any important thing to say end users then we have to attract his visions on that information. So Popup Boxes popping up that information at end user’s sight.

In JavaScript we can create three kind of popup boxes :

Alert Box

Confirm Box

Prompt Box

Alert Box :

An alert box is often used if you want to make sure information comes through to the user.

When an alert box pops up, the user will have to click "OK" to proceed.

Syntax:

alert("Alert Message")

Example:

<html>

<head>

<script language="javascript">

function show_alert()

{

alert("Hi! This is vIsIoNs DeVeLoPeR!!")

}

</script>

</head>

<body>

<input type="button" on click="show alert()" value="Show alert box" >

</body>

</html>

In above example when user click on button one function called that we see deeply in near future tutorials. That Show Alert() function give alert box with content.