I have this script:
$(document).ready(function() {
$('#Checkout1').addClass('disabled');
$('#voorwaarden').change(function() {
$('#Checkout1').attr('disabled', $(this).is(':checked') ? null : 'disabled');
});
});
The script is no change the attr disabled. But how can i change this script to this thing. When you change the #voorwaarden. Than remove the class diabled from #checkout1. And when i changed next the #voorwaarden. Than add class and going furter and furter. #voorwaarden is an checkbox.
Thanks!
Simply do with
toggleClass()Note: http://api.jquery.com/toggleClass/
Edited: In case that you want to toggle ‘disabled’ property,