Write JavaScript to demonstrate the use of different dialogue boxes.
For example: write massages good morning, good bye etc, take value from alert, confirmation for any operation.
CODING:
<!DOCTYPE html>
<html>
<head>
<title>Unit 2 - Q3</title>
<script type="text/javascript">
alert("Good Morning!");
var msg=prompt("Enter a greeting","Hey!");
var check=confirm("Are you sure you want to send this greeting?");
document.write("Greeting : Good Morning!<br><br>");
if(check==1)
{
if (msg==null)
document.write("You didn't enter a greeting.");
else
document.write("Your reply : " + msg);
}
else
document.write("You don't have any manners!");
</script>
</head>
</html>
For example: write massages good morning, good bye etc, take value from alert, confirmation for any operation.
CODING:
<!DOCTYPE html>
<html>
<head>
<title>Unit 2 - Q3</title>
<script type="text/javascript">
alert("Good Morning!");
var msg=prompt("Enter a greeting","Hey!");
var check=confirm("Are you sure you want to send this greeting?");
document.write("Greeting : Good Morning!<br><br>");
if(check==1)
{
if (msg==null)
document.write("You didn't enter a greeting.");
else
document.write("Your reply : " + msg);
}
else
document.write("You don't have any manners!");
</script>
</head>
</html>
Comments
Post a Comment