__________ tag is an extension to HTML that can enclose any number of…

2015

__________ tag is an extension to HTML that can enclose any number of Javascript statements.

  1. A.

    <SCRIPT>

  2. B.

    <BODY>

  3. C.

    <HEAD>

  4. D.

    <TITLE>

Attempted by 230 students.

Show answer & explanation

Correct answer: A

Answer: <SCRIPT> — this tag is used to include JavaScript code in an HTML document.

Key point: The script tag can enclose any number of JavaScript statements between the opening and closing tags.

  • Syntax example: <script> console.log('Hello'); function greet(){ /* ... */ } </script>

  • Placement: script elements can appear in the head or the body. Placing scripts just before the closing body tag often helps page load performance.

  • External scripts: use the src attribute to load external JavaScript files, for example <script src="app.js"></script>

  • Why the other tags are incorrect: <body>, <head>, and <title> are structural or metadata tags. They are not designed to directly enclose JavaScript statements (although script elements may be placed inside head or body).

Explore the full course: Tpsc Assistant Technical Officer