
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to call multiple JavaScript functions in onclick event?
To call multiple JavaScript functions in on click event, use a semicolon as shown below −
onclick="Display1();Display2()"
Example
<html> <head> <script> function Display1() { document.write ("Hello there!"); } function Display2() { document.write ("Hello World!"); } </script> </head> <body> <p>Click the following button to call the function</p> <form> <input type = "button" onclick = "Display1(); Display2()" value = "Result"> </form> </body> </html>
- Related Questions & Answers
- How to call a JavaScript function from an onClick event?
- What is onclick event in JavaScript?
- How to call functions in JavaScript?
- Call a function with onclick() – JavaScript?
- HTML onclick Event Attribute
- How to call a JavaScript function from an onsubmit event?
- How to call a JavaScript function from an onmouseover event?
- How to call a JavaScript function from an onmouseout event?
- How to call a JavaScript function on a click event?
- How can I get onclick event on webview in Android?
- Invoking functions with call() and apply() in JavaScript
- How to call C++ functions from Java?
- How do I run two or more functions when using 'onclick' JavaScript?
- Asynchronous Functions and the Node Event Loop in Javascript
- JavaScript function in href vs. onClick
Advertisements