Multiple choice technology web technology

What is the correct syntax for referring to an external script called "xxx.js"?

  1. <script name="xxx.js">

  2. <script href="xxx.js">

  3. <script src="xxx.js">

  4. <link src="xxx.js">

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

The tag uses the src attribute to reference external JavaScript files. Option A incorrectly uses 'name' which is not the correct attribute, Option B uses 'href' which is for <link> tags, and Option D uses the <link> tag which is for CSS files, not JavaScript.