How would I code an onClick even to collapse an element of a given ID when you click anywhere except that element?
I have a calendar that is collapsed when page loads, and appears when a button is clicked. I’ve added a ‘close’ button, but the natural interaction is to just click away from the large calendar when finished viewing. How can I code this?
This is my first time using Wix so I’m eternally grateful for any help you can provide! Thanks 
You will find the → onBlur-command. 
Oh thanks! Follow-up questions. What would I put for the ‘event’ in the onBlur function? Right now I have this:
$w('#calendar').onBlur( () => {
$w('#calendar').collapse();
})
It did not work for you ?
Your code looks good. Do you use a date-picker?
It seems like not every element has an onBlur-function, but the date-picker should normaly have this function.
https://www.wix.com/velo/reference/$w/datepicker/onblur