JavaScript Quiz

Click on any option

1. What is the HTML tag under which one can write the JavaScript code?

<javascript>

<scripted>

<script>

<js>

2. Which of the following is the correct syntax to display “Namaste” in an alert box using JavaScript?

alertbox(“Namaste”);

msg(“Namaste”);

msgbox(“Namaste”);

alert(“Namaste”);

3. The external JavaScript file must contain <script> tag. True or False?

True

False

4. Which of the following is not a reserved word in JavaScript?

interface

throws

program

short

5. What is the correct syntax for referring to an external script called “geek.js”?

<script src=”geek.js”>

<script href=”geek.js”>

<script ref=”geek.js”>

<script name=”geek.js”>