Home >Web Front-end >JS Tutorial >JavaScript method to call multiple functions at the same time_javascript skills

JavaScript method to call multiple functions at the same time_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:33:171944browse

The example in this article describes how JavaScript can call multiple functions at the same time. Share it with everyone for your reference, the details are as follows:

Here we analyze the implementation method of JavaScript calling multiple functions in the same web page at the same time. After clicking a button, multiple functions are executed, such as multiple windows popping up in succession.

The specific code is as follows:

<html>
<head>
<title>同时调用多个函数</title>
<script language="javascript">
<!--
 function fun1(){
  alert("这是fun1");  
 }
 function fun2(){
  alert("这是fun2");
 }
//-->
</script>
</head>
<body>
<input type="button" value="单击我" onClick="fun1(),fun2()">
</body>
</html>

Run the program to pop up an alert window, and close it to pop up a second window.

I hope this article will be helpful to everyone in JavaScript programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn