Message from JavaScript discussions

December 2020

— Nice control


Hi guys u happen to have a ul element in html i need to target the li under the ul and add a on hover event when ever it it individualy hoverd not all li

— [...yourUl.children].forEach(li => li.addEventListener('hover', whateverFunction));

— But when i queery selector it it returns an array

— Yeah. because ul have multiple lis usually.

— Hence, you forEach over the elements to apply event handlers

— I think i need to research abt the foreach frst

— Start by using node (or the console, or Deno, or whatever) to learn JS before using the DOM.

— How about using IDs?

— Like what

— banofbot

— 🔫 Robert Mendez has been kicked — the only way to get this user back is for admins to manualy unban in chat settings.

Voters who chose to kick:
watzon, Volca-nick, dunklesToast, RubenVerg, solooo7
Powered by Todorant

Message permanent page