+ 1
Can anyone tell me why onclick () function doesn't work when I have a function bound to it in an external .js file??
While it worked when I included the .js file code into my html file.
3 Réponses
+ 4
Add a defer keyword when you import the js file.
<script defer src="..." >
+ 1
Probably you have to write your function inside a window.onload function...
+ 1
Let me just try both these methods....
Thanks for your help