how to toggle attribute in jquery code example
Example 1: jquery toggle class
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
Example 2: jquery toggle attribute disabled
$('#el').prop('disabled', function(i, v) { return !v; });
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
$('#el').prop('disabled', function(i, v) { return !v; });