Problem in manipulating html using JS

sir this was my first js !codeimage|690x388
i included it inside the html code

but when i am manipulating the html content i am being told to write the
linking of javascript file inside body,while was previously inside

can u plz tell why
i am new to JS i am learning it because of IOT.

So far i understood that , You need to know why we must use the tag inside the body tag?
You can use the tag in both the or tag based upon the usage…i provide the clear details upon when we use the appropriate tag for the js to save based upon the function we use.
I too provide the links that made me understand this so refer that for better understanding and i will attach the proof that it also work under the tag.

Refer this to understand…

Links to refer:
From Digital Ocean
from w3 schools
I hope that you will get understand! and feel free to post to clear your doubts from the community.:grinning:
Thank U!:sunglasses:

1 Like