There have a way to make with a click event for #id for example when click on it on every section that got h2 change its color?
Thanks
There have a way to make with a click event for #id for example when click on it on every section that got h2 change its color?
Thanks
document.querySelectorAll(“h2”) should be helpful if you need to change all h2 color
let myDiv= document.getElementById('mydiv');
myDiv.addEventListener('click', function(){
myDiv.style.color = blue;
})
MDN references
HTMLelement.style
addEventListener()