javascript - How to check button is clicked inside a function -


my scenerio:

i have function: function addprocedure() called on onclick of addprocedure button.
in function want check if btnaddselectedprocedures clicked else nothing

 function addprocedure(){         if()// check if button clicked, button id = `btnaddselectedprocedures`            {               //do            }            else{               //do nothing            }     } 

try

$('#btnaddselectedprocedures').click(function(){     $(this).data('clicked', true) }) 

then

function addprocedure(){     if($('#btnaddselectedprocedures').data('clicked')){         //clicked     } else {         //not clicked     } } 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -