+ 2
is this tag neccessary.. before writing javascript program
<script type="text/javascript">
3 Antworten
+ 2
The tag of script is necessary to indicate that the enclosed scripts are JavaScript.
In Sololearn code playground, you feel like you don't need this, but actually the codes in JS tab all are put inside <script></script> and placed into HTML when you run the code.
Further information, they are put before </head>, if you need to get DOM elements, put your scripts In window.onload = function(){
....
}
+ 3
thanks
+ 1
You can remove the type attribute