It can do following operations:
The following example shows an alert dialog box of JavaScript that is contained inside the head tag. Here, we are creating a function msg(). To create this function in JavaScript, We need to write function with function_name as given.
To call function, we need to work on event. Here we are using the onclick event to call msg() function.
<html>
<head>
<script type="text/javascript">
function msg(){
alert("Hello Javatpoint");
}
</script>
</head>
<body>
<p>Welcome to JavaScript</p>
<form>
<input type="button" value="click" >
In this article, we have explained the difference between Java and JavaScript, because most of the time beginners get confused… Read More