I want window.onclick to have the function that I’ve assigned it in the code, but after select_date has been clicked. And when select_date is clicked, I don’t want window.onclick to respond to the same click on select_date. That’s what I thought I created here. (When select_date is clicked, window.onclick should be equal to a declaration / defintion, not a function call)
So what am I missing? Event popping back up to the window after everything has been assigned?
I tried to prevent it with return false, which didn’t work.
Step 1: Capture the event (Define your function with a single parameter)
Step 2: tell that parameter to .preventDefault(), which should prevent bubbling up to the window.