<!DOCTYPE html>
<html>
<head>
<title>Unit 2 - Q3</title>
<script type="text/javascript">
function alertbox(){
alert("This is Alert Box.");
}
function promptbox(){
var msg=prompt("Prompt Box - Enter text/value below");
document.write(msg)
}
function confirmbox(){
var check=confirm("This is Confirm Box.");
if (check==true){
document.write("You pressed OK.")
}
else
document.write("You pressed Cancel.")
}
</script>
</head>
<body>
<input type="button" value="Alert" onclick="alertbox()">
<input type="button" value="Prompt" onclick="promptbox()">
<input type="button" value="Confirm" onclick="confirmbox()">
</body>
</html>
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.