Report Bug
Qus : Which of the following is true about the placement of JavaScript in HTML?
QusHTML में जावास्क्रिप्ट के स्थान के बारे में निम्नलिखित में से कौन सा सत्य है?

A. JavaScript must always be placed inside the tag
B. JavaScript can be placed either in the or tag
C. JavaScript can only be placed in external files
D. JavaScript cannot be placed in the tag


Solution
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.



Report Bug