document.getElementById('categories').addEventListener('click',function(event){
const target = event.target
if(target.classList.contains('category')){
const subcategories = target.querySelector(".subcategories");
if(subcategories){
subcategories.classList.toggle('active');
}
}
});
var element = document.getElementById('myElement')
element.addEventListener('mouseover', () -> {
element.style.backgroundColor = whatever
});
element.addEventListener('mouseout', () -> {
element.style.backgroundColor = whatever
});