JavaScript implements methods that call multiple functions simultaneously

  • 2020-09-28 08:47:59
  • OfStack

This article gives an example of how JavaScript implements the method of calling multiple functions simultaneously. To share for your reference, the details are as follows:

Here, the implementation method of JavaScript calling multiple functions in the same page at the same time is analyzed. After clicking the button, the function is executed for multiple times, such as popping up multiple Windows continuously.

The specific code is as follows:


<html>
<head>
<title> Multiple functions are called simultaneously </title>
<script language="javascript">
<!--
 function fun1(){
  alert(" This is a fun1");  
 }
 function fun2(){
  alert(" This is a fun2");
 }
//-->
</script>
</head>
<body>
<input type="button" value=" Click on the I " onClick="fun1(),fun2()">
</body>
</html>

Run this program and the alert window will pop up. After closing, the second window will pop up.

I hope this article has been helpful in JavaScript programming.


Related articles: