A very useful tutorial about calling JavaScript without events. Around eight different methods, good for beginners. https://maqlearning.com/call-javascript-function-html-without-onclick