the js code works fine when I manually put it in Chrome dev console and run it but it gives an error when I run it from index.html with the src tag
the js code works fine when I manually put it in Chrome dev console and run it but it gives an error when I run it from index.html with the src tag

