document.querySelectorAll('.name a h1').forEach(el => {
el.style.color = 'blue';
el.addEventListener('mouseenter', => {
el.style.color = 'red'; });
el.addEventListener('mouseleave', => {
el.style.color = 'yellow'; });
});
- How to set a color correctly: for a text or for a link?
- Is this even a working design?
The question is theoretical, will it work or not? Or are the principles of JS violated here ?