Simple JavaScript Quiz

Test your knowledge in JavaScript Fundamentals

1. In which HTML element do we put in JavaScript code?

a. <js>
b. <script>
c. <body>
d. <link>

2. Which HTML attribute is used to reference an external JavaScript file?

a. src
b. rel
c. type
d. href

3. How would you write "Hello" in an alert box?

a. msg("Hello");
b. alertBox("Hello");
c. document.write("Hello");
d. alert("Hello");

4. JavaScript is directly related to the "Java" programming language

a. True
b. False

5. A variable in JavaScript must start with which special character

a. @
b. $
c. #
d. No Special Character