+ 2
Can anyone explain me why k.style.display="none" don't works in script tag in last line?
6 Réponses
+ 1
in the first event listener you use document.documentElement. this will be active whenever the page is clicked as it will display block. this is in conflict with the second event listener.
+ 2
Logomonic Learning thks I was wondering same
+ 2
Yup
+ 1
Alternative: Could use event.cancelBubble - "a setting of true before returning from an event handler prevents propagation of the event." MDN.
https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble
+ 1
ODLNT thank you
0
you will need to remove the first event listener