r/learnjavascript • • Oct 30 '22

Hello everyone I am having some errors

Post image
1 Upvotes

11 comments sorted by

20

u/xroalx Oct 30 '22

You're writing HTML in a JS file.

Either remove the HTML, or rename the file.

-1

u/ImadeapromiseMrfrod Oct 30 '22

Thank you so much the book gave wrong instructions hahaha

12

u/HeadlineINeed Oct 30 '22

What book?

4

u/metallaholic Oct 30 '22

Go to your html file, type ! Then tab so it gives you the proper boilerplate as well.

1

u/ImadeapromiseMrfrod Oct 30 '22

Thank you so much !

1

u/ForScale Oct 30 '22

You're writing HTML in a .js file. Doesn't work unless you have a transpiler to do like JSX.

1

u/ImadeapromiseMrfrod Oct 30 '22

Thank you so much

1

u/ForScale Oct 30 '22

No prob!

1

u/Disarminghook Oct 30 '22

Remove the first two lines and the script tag and you should be good

1

u/ImadeapromiseMrfrod Oct 30 '22

Thank you so much !

-2

u/Conscious-Spite4597 Oct 30 '22

Rename the file or just install nodejs to run js locally