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