Im trying to make ultimate code, that will find if the checkbox is checked and so after click it will enable the dependable block. That wasn't hard. But is it possible to make code work with the other alike elements without need to copy/paste code for each id or class. Here is the code: http://ift.tt/1FT1lB1
$('.main').click(function() {
if ($(".dependable").is("[disabled]")) {
$(".dependable").removeAttr('disabled');
} else {
$(".dependable").attr('disabled', 'true').removeAttr('checked');
}
});
Aucun commentaire:
Enregistrer un commentaire