Home > Web Front-end > JS Tutorial > body text

JavaScript method to call multiple functions at the same time_javascript skills

WBOY
Release: 2016-05-16 15:33:17
Original
1871 people have browsed it

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>
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!