function_clickOutside(){document.addEventListener("click",function(event){if(event.target.closest(".dropdown")){//replace the class name to your needsreturn;}close();//just calling a function that removes classList of isOpen},false);}
Hope this can help :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello Emma,
Great post indeed.
Just wanted to know, how would you close the dropdown if we click outside of the dropdown without selecting any option?
Thanks,
Hope this can help :)