I keep getting unexpected syntaxerror token < line 2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I keep getting unexpected syntaxerror token < line 2

alert("This is an alert box!"); <html> <head> <title></title> <script type="text/javascript"> Alert("this is an alertbox!"); </script> </head> <body> </body> </html>

4th May 2018, 11:30 AM
Damian Borkowski
Damian Borkowski - avatar
4 Answers
+ 1
all the JavaScript program should be inside <script> tag. second thing is that alert must be in lowercase.
4th May 2018, 11:37 AM
Alpha Rays
Alpha Rays - avatar
0
well by the looks of it you're trying to put html code in the javascript part of a web code html and js each go in their own respective sections
4th May 2018, 11:34 AM
hinanawi
hinanawi - avatar
0
So how should I put it
4th May 2018, 11:35 AM
Damian Borkowski
Damian Borkowski - avatar
0
Alright thank you!
4th May 2018, 11:37 AM
Damian Borkowski
Damian Borkowski - avatar