Documentation and Books

Recent site activity

Web Development‎ > ‎JavaScript‎ > ‎

How to display an alert message?

The following example will display an alert message:

  <html>
<head>
<script language="JavaScript">
function displayAlert() {
alert('Message!');
}
</script>
</head>
<body>
<input type="button" onclick="displayAlert();" value="Click Me!"/>
</body>
</html>