active One button and de-active another button - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

active One button and de-active another button

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.4.2.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from w w w . j av  a 2  s . c om
$('button').click(function(){
    $(this).attr('disabled', true).siblings('button').attr('disabled', false);
    return false;
});
    });

      </script> 
 </head> 
 <body> 
  <button id="btnOne">Button 1</button> 
  <button id="btnTwo" disabled>Button 2</button>  
 </body>
</html>

Related Tutorials