Disable/enable element with checkbox and jQuery? -


I have a checkbox and if I tick it, then I want to enable a text field (disabled as default ) And when I uncheck the checkbox I want to disable it again.

I saw how I toggle the CSS CSS class and here I can switch between enabled and disabled with two buttons

= "Text">

  $ (': checkbox'). Click (function () {$ ('input: text'). Attr ('disabled',! This.checked)});  


Comments