Show or hide a jQuery element given a condition

If you have jQuery code like this:

if (condition) {
  $element.show();
} else {
  $element.hide();
}

... you can shorten this to:

$element.toggle(condition);
Henning Koch