Yes it is possible if you bind events using tag attribute onclick="sayHi()"
directly in template similar like your <body onload="start()">
- this approach similar to frameworks angular/vue/react/etc. You can also use <template>
to operate on 'dynamic' html like here. It is not strict unobtrusive js however it is acceptable for small projects
function start() {_x000D_
mydiv.innerHTML += "bar";_x000D_
}_x000D_
_x000D_
function sayHi() {_x000D_
alert("hi");_x000D_
}
_x000D_
<body onload="start()">_x000D_
<div id="mydiv" style="border: solid red 2px">_x000D_
<span id="myspan" onclick="sayHi()">foo</span>_x000D_
</div>_x000D_
</body>
_x000D_