Gazebo_simulation-Frontend/node_modules/dom-helpers/esm/toggleClass.js
2020-12-21 10:29:31 -05:00

6 lines
337 B
JavaScript

import addClass from './addClass';
import hasClass from './hasClass';
import removeClass from './removeClass';
export default function toggleClass(element, className) {
if (element.classList) element.classList.toggle(className);else if (hasClass(element, className)) removeClass(element, className);else addClass(element, className);
}