Why there’s error in onclick when i have “module” in script tag? [duplicate]

Default scope in modules is the module and not global.

Attach event handlers using addEventListener in JavaScript instead of intrinsic event attributes in HTML.

Leave a Comment