skip to Main Content

Add a class to all sibling element if one of the element gets that same class when clicked? – Javascript

const images = document.querySelectorAll(".img_items"); images.forEach((image) => { image.addEventListener("click", () => { image.classList.add("select"); }); }); .img_items::after{ content: ' ' attr(class) } <div class="img_container"> <div class="img_items ">1</div> <div class="img_items ">2</div> <div class="img_items">3</div> <div class="img_items">4</div> </div> I tried adding the class to the…

VIEW QUESTION

Mongodb document object array filter

How can I filter if all num of qty greater then 50 then this is return otherwise not: this is examples documents; { _id: ObjectId("5234cc89687ea597eabee675"), code: "xyz", tags: [ "school", "book", "bag", "headphone", "appliance" ], qty: [ { size: "S",…

VIEW QUESTION
Back To Top
Search