MCQ Answer

Which of the following is true about the placement of JavaScript in HTML?

Which of the following is true about the placement of JavaScript in HTML?

HTML में जावास्क्रिप्ट के स्थान के बारे में निम्नलिखित में से कौन सा सत्य है?
Topic : JS Basic Syntax and Data Types

A. JavaScript must always be placed inside the <head> tag

B. JavaScript can be placed either in the <head> or <body> tag

C. JavaScript can only be placed in external files

D. JavaScript cannot be placed in the <head> tag




Correct Answer is :

B. JavaScript can be placed either in the <head> or <body> tag



Explanation
JavaScript can be placed either in the or tag of an HTML document. The placement depends on when you want the script to execute: placing it in the will run it before the content loads, while placing it in the ensures it runs after the content.
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad