Saturday, 25 August 2012

How can I show Messagebox with HTML Code


In HTML we cannot use not use 'vbscript' command 'msgbox' to display the messagebox or any other window message commands, becuse html viewed in web browser. So thewindow message not display on It.

We can display message on web form by use the following code.

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction()
{
     alert("Hello! I am an alert box!");
}
</script>
</head>
<body>
<input type="button" onclick="myFunction()" value="Show alert box" />
</body>
</html>

In above html code we type a 'javascript functon' named 'myFunction()'. We use 'alert' command in this function. This command is used to display message on Web Browser. 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Twitter Bird Gadget