How to disable/enable an input box with jQuery?

We can easily disable input box(textbox,textarea) using disable attribute to “disabled”.

$(‘elementname’).attr(‘disabled’,’disabled’);

To enable disabled element we need to remove “disabled” attribute from this element.

$(‘elementname’).removeAttr(‘disabled’);

Example


   ed
      
      
   


       
Updated on: 2020-06-22T07:59:30+05:30

18K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements