Multiple choice

What is the HTML tag under which one can write the JavaScript code?

  1. <javascript>

  2. <script>

  3. <scripted>

  4. <js>

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

In HTML documents, JavaScript code must be placed inside the '' tag. This tells the browser to interpret the enclosed text as executable script code rather than standard HTML markup.