Simple JavaScript Quiz

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. rel="nofollow noopener" target="_blank" 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