javascript - check one button click on another button click -


i have 2 buttons next , add. want user click next after clicking add button. if user don't click on add button , click on next button should alert, click on add button.

conside example

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <body>  <button id="next">next</button>  <button id="add">add</button>  <script>    $(function(){      var addclicked = false;      $('#next').on('click', function(){        // code execute        addclicked = true;        alert('add clicked');      });      $('#add').on('click', function(){        if(addclicked == true){          addclicked = false;          // code execute          }else{          alert('please click next');        }              });    });  </script>  </body>

add button proceed after next button clicked


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -