I have a query regarding window and document objects based on modal window.
Below is my code
My question is regarding this block
Should this not be 'document.onclick' instead of 'window.onclick'?
Below are definitions :
The window object represents the browser window.
The document object represents the HTML document loaded in that window.
Even though replacing window with document works, I want to know what is right here.
Is it right to click anywhere on browser to close modal?