I stumbled upon this function of JS in w3schools and im curious about windows.onlick, function(event) and event.target == modal, what they are and how they work? I know event.target == modal could be that event targets the modal, does it mean that when we use window.onlick, it means clicking anywhere on window? And later asign it function(event) for what ever event to work in this case clicking anywhere on window but if we click anywhere on window to make Modal in this code to dissapear since it was styled as display:none in If statement? Am i understanding this well? Why did he use event.target == modal? event needs to equal what we wish to trigger?
https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_signup_form_modal