No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
myElement.addEventListener('click', function(){ | myElement.addEventListener('click', function(){ | ||
console.log('clickediclick'); | console.log('clickediclick'); | ||
document.querySelectorAll('.team-list players').forEach(function(el){ | document.querySelectorAll('.team-list .players').forEach(function(el){ | ||
console.log(el); | console.log(el); | ||
el.classList.toggle('show'); | el.classList.toggle('show'); |
Revision as of 20:40, 11 September 2022
/* Any JavaScript here will be loaded for all users on every page load. */
(function () {
var myElement = document.getElementById('team-toggle');
if ( myElement ) {
myElement.addEventListener('click', function(){
console.log('clickediclick');
document.querySelectorAll('.team-list .players').forEach(function(el){
console.log(el);
el.classList.toggle('show');
});
});
}
}());