Switch disabled with jQuery

function SwitchDisabled(element) {
  if ($(element).attr('disabled')) $(element).removeAttr('disabled');
  else $(element).attr('disabled', true);
}