JS: Hide an element when clicking on somewhere else
Hint: I used the functions removeClass() and addClass() to make things easier. You can find them on
Hint: I used the functions removeClass() and addClass() to make things easier. You can find them on
If you're like me and come from jQuery to pure JavaScript, these helper functions might be very helpful for you: function hasClass(el, className) { if (el.classList) return el.classList.cont...