The script tag must be placed in
Answers
The script tag should be used always before body close or Bottom in HTML file.
Explanation:
The script tag is used to identify a client-side JavaScript. The script element holds scripting statements, or a pointer to an external script file using a relevant attribute. The JavaScript mostly used for manipulating image, validating form and changing content dynamically.
The script tag is used before body close or Bottom in HTML file to see the content of the page first before loading javascript file. The normal practice is to place the script tag at the bottom so that the entire document object model loaded before the start of any execution.
Answer:
The script tag must be placed in Head and Body tag
Explanation:
Script tag must always be placed in head and body tag. A script tag is always used whenever we need to write a javascript code in the program. A javascript is a client side scripting language where the programmer wants to perform certain validation in the client side.
If the scripts are placed after the body tag, then there is no use since it is not visible to the code inside the body and most of the important business requirements are written in body tag only. But it is always recommended to place scripts in Head tag.