© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Mateusz Pigula
Don't you have a mistake in the 7th snippet? '#my-element' is just a string. We should pass there document.querySelector('#my-element') or ref, or query for an element inside the onClickOutside function, right?
'#my-element'
document.querySelector('#my-element')
onClickOutside