function showTERMINATION() {
var elements = document.querySelectorAll("foreignObject");
elements.forEach(function(element) {
console.log(element.classList);
element.classList.add('inactive');
console.log(element.classList);
});
}
Solution 2: without logs and with arrow notation:
function showTERMINATION() {
var elements = document.querySelectorAll("foreignObject");
elements.forEach(
(element) => element.classList.add('inactive')
);
}
Solution 3: And for good measure, with logs and with arrow notation:
function showTERMINATION() {
var elements = document.querySelectorAll("foreignObject");
elements.forEach(function(element) {
console.log(element.classList);
});
elements.forEach(
(element) => element.classList.add('inactive')
);
elements.forEach(function(element) {
console.log(element.classList);
});
}