Jul 2, 2014

Alert message in javascript

We will use the inbuilt alert function in javascript for alerting the user with some message.
The following example will show you how to call the alert function. 

Design:


<input type="button" value="GetDateTime" onclick="showdatetime();" />




<script language ="javascript"> 


function showdatetime()
{
 alert(new Date());
}
</script>


O/P :




Once you click on this button you will get the alert that contains date and time

 


 

No comments:

Post a Comment