Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- var $btn1 = $("#btn1");
- var $btn2 = $("#btn2");
- var active1 = true;
- var active2 = false;
- $btn1.click(function(){
- $active1 = false;
- $active2 = true;
- alert("after btn1 click: --> " + " active1: " + active1 + ", active2: " + active2);
- });
- $btn2.click(function(){
- // If clicked first on btn1 I'm expecting active1=false; active2=true; ??
- alert("after btn2 click: " + " active1: " + active1 + ", active2: " + active2);
- });
- });
- <button id="btn1">Button1</button>
- <button id="btn2">Button2</button>
- $btn1.click(function(){
- active1 = false;
- active2 = true;
- alert("after btn1 click: --> " + " active1: " + active1 + ", active2: " + active2);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement