Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.addEventListener("DOMContentLoaded", function() {
- // Zadanie 1
- document.querySelectorAll(".parent").forEach(function(el) {
- el.addEventListener("mouseover", function() {
- el.querySelector(".children").style.display = "block";
- })
- })
- // document.querySelectorAll(".parent").forEach(function(el) {
- // el.addEventListener("mouseout", function() {
- // el.querySelector(".children").style.display = "none";
- // })
- // })
- function hideChildrenElement(e) {
- console.log(e);
- this.querySelector(".children").style.display = "none";
- }
- document.querySelectorAll(".parent").forEach(function(el) {
- el.addEventListener("mouseout", hideChildrenElement);
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement