Detect click outside HTML element

Date posted: 3/3/2024

This is a fairly easy thing to do, but I never found a concise and simple explanation for it. This is my attempt at doing that.