suppose I write a if-else statement like this :
const dropItem = document.querySelectorAll('.menu-content67');
dropItem.forEach((dItem) => {
let hideIcon = dItem.querySelector('.hide-icon67');
hideIcon.addEventListener('click', () => {
dropItem.forEach((dItem2) => {
if (dItem !== dItem2) {
dItem2.classList.remove('showMenu')
}
})
if (dItem.classList.contains('showMenu')) {
dItem.classList.remove('showMenu')
}
else {
dItem.classList.add('showMenu')
}
})
})
now I want to find the return value for below portion
dropItem.forEach((dItem2) => {
if (dItem !== dItem2) {
dItem2.classList.remove('showMenu')
}
})
Aucun commentaire:
Enregistrer un commentaire