To apply both an external script and an inline script in one page, what should she do?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

To apply both an external script and an inline script in one page, what should she do?

When you want both an external script and some inline code on the same page, you should use two separate script elements. One script tag should load the external file with the src attribute, and another script tag should contain the inline code without a src. A script tag that has a src attribute does not execute its inline content, so you can’t put both inside one tag. Using two tags lets you control the order: place the external script first so its functions are available to the inline code that follows. The defer attribute only affects external scripts and won’t help combine inline code with an external file in a single tag, so it’s not a solution here.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy