New developers learn the framework and never learn how HTTP and HTML work.
Experienced developers have to learn how to punch through the framework to get to these features we get automatically with statically hosted assets.
https://unplannedobsolescence.com/blog/behavior-belongs-in-h...
<button onclick="alert('I was clicked!')">Click me</button>
,,You can find HTML attribute equivalents for many of the event handler properties; however, you shouldn't use these — they are considered bad practice. It might seem easy to use an event handler attribute if you are doing something really quick, but they quickly become unmanageable and inefficient.''
,,You should never use the HTML event handler attributes — those are outdated, and using them is bad practice.''
And then proceeds to suggest this:
<button>Click me</button>
<script> const btn = document.querySelector("button")
btn.addEventListener("click", () => { alert('I was clicked!') }) </script>
After this, next step would be putting javascript to a separate file, and on a slow mobile connection in a random airport with thousands of people using the same wifi, a simple working code gets timeouts.
20 years ago all I needed to know was this, and it worked great:
<button onclick="alert('I was clicked!')">Click me</button>