Wednesday 21 March 2018

How to use the alert box in JavaScript


The alert box is generally used to display an alert message while executing JavaScript code. Now here We create a Web page named alertBoxUse.html which shows the use of alert box.

##### Showing the code for the alertBosUse.html file #####
<!DOCTYPE html>
<html>
<head>
<title>using the alert box</title>
</head>
<body bgcolor=”#FFSSTT” text=”green”>
<h1>Showing the alert box</h1>
<SCRIPT type=”text/javascript”>
alert(“Hello, I m an alert box.”);
</SCRIPT>
</body>
</html>


We have used an alert box to display a message stating Hello, I am an alert box when the alertBoxUse.html page loads.




No comments:

Post a Comment