Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. Studi

    JavaScript How to close the selection if I click outside?

    const selectBtn = document.querySelectorAll(".select-btn"); const options = document.querySelectorAll(".select-btn label"); selectBtn.forEach(function (button, index) { button.addEventListener("click", () => { button.classList.toggle("active"); selectBtn.forEach(function (button2...
  2. Studi

    JavaScript How can I include document?addEventListener in this function.

    I have a few dropdown selection lists and want them to exit if you click anywhere on the site/document(make the aria-expanded false) because at the moment it exits only if you click on itself or one of the items inside the dropdown. const selection =...
Back
Top Bottom