jquery toggle attribute 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; });
Example 3: toggle attribute jquery
// Troggle attribute in jquery
$( selector ).attr('disabled', function(_, attr){ return !attr});