/** * A function to add multiple CSS classes to all elements * with a specific class name. * @param {string} targetClass The class of the elements to select. * @param {string[]} classesToAdd An array of class names to add. */ function addClassesToElements(targetClass, classesToAdd) { // Select all elements that have the target class. const elements = document.querySelectorAll(`.${targetClass}`); // Iterate over each element found. elements.forEach(element => { // Add all the classes from the 'classesToAdd' array to the element. element.classList.add(...classesToAdd); }); } // Example usage: // To add the classes 'sqsrte-text-color--black' and 'some-other-class' // to all divs with the class 'seated-event-date-cell': addClassesToElements('seated-event-date-cell', ['sqsrte-text-color--black']);