Disable a button using jquery - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

Disable a button using jquery

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://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script> 
      <script type="text/javascript">
    window.onload=function(){/*  w  ww  .  j a  va 2s  . c  o m*/
$("#foo").prop('disabled', true);
    }

      </script> 
   </head> 
   <body> 
      <form> 
         <input id="foo"> 
         <input id="bar"> 
      </form>  
   </body>
</html>

Related Tutorials