I'm pretty new to jQuery and just playing around right now. I'm trying to create a click event which has to the the attribute 'disabled' for a <select></select>
to true/false whenever it's clicked.
So it's starting on disabled[true] and when clicking on a link it's going to disabled[false] - cool. But now I wan't to make it possible to set it back to disabled[true] with the same link.
My code is as following:
$('.enableSelects').click(function(){
if($('select').is(':hidden')){
$('select').attr('disabled', true);
} else {
$('select').attr('disabled', false);
}
});