Problem with event handlers and DOM [SOLVED]
https://drive.google.com/file/d/1Y1FPxcNWdv2IUTHSUmfjbvlUWCf_L8lp/view?usp=drivesdk This is a link to the video of my problem Here is the code JS varĀ pageĀ =Ā document.querySelectorAll(".details"); varĀ btnĀ =Ā document.querySelectorAll("button"); varĀ bookĀ =Ā document.querySelector(".card"); varĀ placeĀ =Ā 0; for(varĀ iĀ =Ā 0;Ā iĀ <Ā btn.length;Ā i++){ Ā Ā Ā Ā placeĀ =Ā i; Ā Ā Ā Ā btn[i].addEventListener("click",Ā function(){ page[place].style.transformĀ =Ā "rotateY(-135deg)"; Ā Ā Ā Ā }); } book.addEventListener("mouseleave",Ā function(){ for(varĀ iĀ =Ā 0;Ā iĀ <Ā page.length;Ā i++){ page[i].style.transformĀ =Ā ""; } }); The first button worked fine But other buttons are not working Please tell me a solution for it. You can Debug at Codepen https://codepen.io/sarthakg043-the-selector/pen/jOOVyNQ