just a guy just a guy - 5 months ago 32
jQuery Question

How can I enable a fieldset?

Normal disclaimer that I'm a terrible web developer.

I was lead to believe that, with a

<fieldset disabled id="homeFieldset">...</fieldset>
, I could enable its controls with
$("homeFieldset").disabled = false
, but alas...nothing. Also, I'm testing this in Chrome, where it should work. Fiddle: https://jsfiddle.net/ggrxx4hm/1/

FWIW, debugging shows me that
$("#homeFieldset").disabled
is undefined. However, if I do
$("#homeFieldset")[0].disabled = false
, it works. Fiddle: https://jsfiddle.net/7edje5vk/

Edited selector in second paragraph.

Edit again: But why doesn't
.disabled = false
work?

Answer

JS Fiddle

$("#homeFieldset").prop('disabled', false);