Multiple choice technology web technology

Inside which HTML element do we put the JavaScript?

  1. <scripting>

  2. <javascript>

  3. <js>

  4. <script>

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

JavaScript code is embedded in HTML using the element. This can be placed in either the head or body section. The <scripting>, <javascript>, and <js> tags are not valid HTML elements for JavaScript.

AI explanation

To include JavaScript code in an HTML document, we use the `` element.

Let's go through each option to understand why it is correct or incorrect:

Option A) &lt;scripting&gt; - This option is incorrect because there is no HTML element called &lt;scripting&gt;. The correct element to include JavaScript is &lt;script&gt;.

Option B) &lt;javascript&gt; - This option is incorrect because there is no HTML element called &lt;javascript&gt;. The correct element to include JavaScript is &lt;script&gt;.

Option C) &lt;js&gt; - This option is incorrect because there is no HTML element called &lt;js&gt;. The correct element to include JavaScript is &lt;script&gt;.

Option D) &lt;script&gt; - This option is correct because we use the &lt;script&gt; element to include JavaScript code in an HTML document. This is the correct answer.

The correct answer is D) &lt;script&gt;.