Professional Documents
Culture Documents
Alert box
<!DOCTYPE html>
<html>
<head>
<title> Using alert box </title>
</head>
<body>
<h1>Showing the alert box</h1>
<script type="text/javascript">
alert("Hello I Am Alert Box");
</script>
</body>
</html>
Assignment-10
Output
prompt box
<html>
<head><title>prompt box</title></head>
<body>
<h1>accepting your name using prompt box</h1>
<script type="text/javascript">
var name=prompt("Please enter your name: ");
if (name=="") name="visitor";
{
document.write("hi"+name+"welcome to
javascript");
}
Assignment-10
</script>
</body>
</html>
Output
Conform box
<html>
<head><title>conform box</title></head>
<body>
<script type="text/javascript">
var qry=confirm("are you sure to send this file to
recycle bin ?");
Assignment-10
if(qry)
document.write("welcome to java script <br> you
have moved this file to recycle bin");
else
document.write("welcome to java script<br>the file
is not moved ");
</script>
</body>
</html>
Output
</script>
</body>
</html>
Output
Assignment-10