title: Check if textbox disabled or enabled in JavaScript
body: <p>How do I check if a textbox is disabled or enabled in JavaScript? I just want to know if a textbox is enable or disabled on button click. If the textbox is disabled I want to alert the user with the message "disabled" and if it is enable, the alert message will be "enabled".</p>
  
  <pre><code>&lt;script&gt;
   function CheckTextbox(){
  
      if(textbox1 is disabled){ //here
        alert("disabled");
      }else{
        alert("enable");
      }
  
     if(textbox2 is disabled){ //here
        alert("disabled");
     }else{
        alert("enable");
     }
  }
  &lt;/script&gt;
  
  &lt;input type="text" id="textbox1" disabled="disabled"&gt;
  &lt;input type="text" id="textbox2"&gt;
  &lt;input type="button" onclick="CheckTextbox();"&gt;
  </code></pre>