checkbox-enabled-disabled
HTML
<div class="billing">
<input type="checkbox" class="billing-checkbox" checked>
<input type="button" value="Hello Javascript!">
</div>
JavaScript
$(document).ready(function() {
$('.billing-checkbox').prop('checked', localStorage.getItem('buttonDisabled') !== "disabled");
toggleBilling({
target: $('.billing-checkbox')[0]
})
$('.billing-checkbox').on('change', toggleBilling);
});
function toggleBilling(e) {
$('.billing input[type="button"]').attr('disabled', !e.target.checked)
localStorage.setItem('buttonDisabled', $('.billing input[type="button"]').attr('disabled'));
}