https://notesontech.com/javascript-dom-page-loaded/
How to execute JavaScript code only after the HTML structure (or the whole page) is loaded