Script tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Script tag

when we creating a programme of js in html it necessary to give body tag or not?

23rd Dec 2016, 3:20 AM
Omkar Dolase
Omkar Dolase - avatar
1 Answer
+ 1
If you are putting javaScript on a page anywhere it needs to be in a <script></script> block. You can put it in the <head></head> or <body></body> blocks. The only time you don't need that is for individual commands that will the action to take as a result of onclick, onmouseover, etc... events.
23rd Dec 2016, 7:21 AM
Kevin Gilkey-Graham
Kevin Gilkey-Graham - avatar