How to Check If a DOM Element Is Visible in the Viewport in JavaScript | CodeTrail