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
Post a Comment