0

Is this script correct?

alert("This is an alert box!"); <script type=“text/javascript"> document.write(“Hello world <br/>”); document.write(“Goodbye world”) Please tell me im new

18th Dec 2017, 8:55 AM
Sean Coyle
Sean Coyle - avatar
2 Answers
+ 7
Also, in HTML 5, the default script type is Javascript, so you can just drop the type attribute for cleaner code.
18th Dec 2017, 10:27 AM
Eric Blinkidu
Eric Blinkidu - avatar
+ 6
The alert should be placed inside the script tag, and you seem to forget to close the script tag with its pairing </script>. And a semicolon after the "Goodbye world". <script type=“text/javascript"> alert("This is an alert box!"); document.write(“Hello world <br/>”); document.write(“Goodbye world”); </script> <!-- You forgot this --> Hth, cmiiw
18th Dec 2017, 9:01 AM
Ipang