JAVASCRIPT EXAMS SET COMPREHENSIVE
QUESTIONS AND SOLUTIONS HIGH SCORE
PREPARATION
●● Where can JavaScript code be inserted in an HTML document?
Answer: Between the <script></script> tags in the <head> or <body>.
●● How do you include an external JavaScript file in HTML?
Answer: Use <script src='myScript.js'></script>.
●● How can you use a URL to include an external JavaScript script?
Answer: Insert the URL into the src attribute of the script tag.
●● Is the type attribute required in JavaScript script tags?
Answer: No, it is not required.
●● What is the default scripting language in HTML?
Answer: JavaScript.
●● What is a JavaScript function?
Answer: A block of JavaScript code that can be executed when called.
QUESTIONS AND SOLUTIONS HIGH SCORE
PREPARATION
●● Where can JavaScript code be inserted in an HTML document?
Answer: Between the <script></script> tags in the <head> or <body>.
●● How do you include an external JavaScript file in HTML?
Answer: Use <script src='myScript.js'></script>.
●● How can you use a URL to include an external JavaScript script?
Answer: Insert the URL into the src attribute of the script tag.
●● Is the type attribute required in JavaScript script tags?
Answer: No, it is not required.
●● What is the default scripting language in HTML?
Answer: JavaScript.
●● What is a JavaScript function?
Answer: A block of JavaScript code that can be executed when called.