aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/toggleElement.js
blob: c87561d00c378c9764c3748907f54afd44780c7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * Hides and shows any html element
 * @param {string} elementId the id of the element to toggle
 */
export function toggleElement(elementId) {
  const element = document.getElementById(elementId);
  if ("nodisplay" in element.classList) {
    element.classList.remove("nodisplay");
  } else {
    element.classList.add("nodisplay");
  }
}
window.toggleElement = toggleElement;
export default toggleElement;