-
Posts
7 -
Joined
-
Last visited
Community Answers
-
tomek_piatek's post in Custom event handler for "onclick" is not firing was marked as the answer
Arrrith... I solved the problem. I was binding my event handler when the DOM has finished loading. That is too soon. I changed it to when the page has finished loading and that works.
This:
window.addEventListener("load", (event) => {... instead of this:
document.addEventListener("DOMContentLoaded", function() {...