Calling multiple JavaScript functions on a button click

前端 未结 11 1654
灰色年华
灰色年华 2020-12-23 22:37

How to call multiple functions on button click event?

Here is my button,



        
11条回答
  •  青春惊慌失措
    2020-12-23 23:42

    if there are more than 2 js function then following two ways can also be implemented:

    1. if you have more than two functions you can group them in if condition

      OR

    2. you can write two different if conditions.

    1 OnClientClick="var b = validateView(); if (b) ShowDiv1(); if(b) testfunction(); return b">

    OR

    2 OnClientClick="var b = validateView(); if(b) {

    ShowDiv1();

    testfunction();

    } return b">

提交回复
热议问题