ded / bonzo

library agnostic, extensible DOM utility
Other
1.32k stars 137 forks source link

disable #9

Closed dvv closed 13 years ago

dvv commented 13 years ago

Hi! How do I disable/enable elements with bonzo? TIA

ded commented 13 years ago
$('input[type=text]').attr('disabled', true);
MartinodF commented 13 years ago

Just in case anyone else in the future finds this issue while googling, here's how to re-enable elements:

$('input[disabled]').removeAttr('disabled');

.attr('disabled', false) will just set disabled="false", which is still considered disabled in HTML5

ded commented 13 years ago

Github has the worst SEO juice, so it probably won't be a problem. But thanks for the tip :)

MartinodF commented 13 years ago

I have to agree, it took an input disabled ender bonzo github query to get this page as the third result, but that's how I got here in the first place, so there's always a chance ;) Thanks for the wonderful library!