How would I do an if...then statement for this piece of code?
$('body').on('click', '.icon-lock', function () {
var lockedarea = $(this).parents(0).eq(2);
$(lockedarea).find('input[type=text],input[type=checkbox],textarea,select').prop('disabled', true);
});
Right now when I click it, what I want to happen happens as far as those inputs becoming uneditable. However I'm trying to say that if this button is pressed, then this happens. And if it's pressed again, then .prop('disabled', false). However as I'm just starting out, I get confused easily when doing this sort of thing.