Find out how you could raise an alert using Javascript.

Using alert you could raise a popup message so you can inform the user to do something.

The command for the alert is:

alert('Enter some text');

javascript-alert

HTML CODE EXAMPLE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Javascript: How to raise an Alert</title>

<script language="javascript" type="text/javascript">

 

function OpenAlert() {

alert('This is an example of an alert popup');

}

</script>

 

</head>

<body>

Click to open the popup message <br />

<button onclick="OpenAlert()" type="button">Click to Open</button>

</body>

</html>

 
* iOS Development * OS X * Product Review