0

receiving error for no reason

When I was going to write in this code: <html> <head> </head> <body> <script> document.write("Hello World!"); </script> </body> </html> I received a message telling me there is an error in line 1 of an unexpected token '<' and another error in line 2. but I have literally copied the whole code and I don't know what's wrong.

8th Feb 2020, 9:06 PM
Khaled Hondg
4 Réponses
+ 6
From what I see, there is nothing wrong in that piece of code. Hm..
8th Feb 2020, 9:11 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 6
blackwinter No need to write <!DOCTYPE html>
8th Feb 2020, 9:39 PM
A͢J
A͢J - avatar
+ 5
Write it in code playground, and then share the link here, it would be better.
8th Feb 2020, 9:10 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 3
Khaled Hondg You must put HTML in HTML tag. Check bluesea's code. Your code is in Js tag: https://code.sololearn.com/W1QAkvwaVqz7/?ref=app
9th Feb 2020, 12:49 AM
Kevin ★