Calling multiple JavaScript functions on a button click

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

How to call multiple functions on button click event?

Here is my button,



        
11条回答
  •  爱一瞬间的悲伤
    2020-12-23 23:28

    I think that since return validateView(); will return a value (to the click event?), your second call ShowDiv1(); will not get called.

    You can always wrap multiple function calls in another function, i.e.

    
    
    function display() {
       if(validateView() && ShowDiv1()) return true;
    }
    
    

    You also might try:

    
    

    Though I have no idea if that would throw an exception.

提交回复
热议问题