Question 1/7: In which HTML element do we write the JavaScript code?
• <javascript>20%bar
• <js>20%bar
• <script>60%bar
• <java_script>0%bar
Question 2/7: Where is the correct place to insert a JavaScript?
• <head>40%bar
• <body>20%bar
• both of the above20%bar
• none of the above20%bar
Question 3/7: How do you write "Hello World" in an alert box?
• alert("hello world")60%bar
• alertbox("hello world")40%bar
• msgbox("hello world")0%bar
• alert=("hello world")0%bar
Question 4/7: How do you call a function named "myFunction"?
• call myFunction()20%bar
• myFunction()80%bar
• call function myFunction()0%bar
• new functionCall myFunction()0%bar
Question 5/7: How do you write a conditional statement for executing some code if "i" is equal to 5?
• if i=5 then20%bar
• if i==5 then20%bar
• if(i==5)40%bar
• if i=520%bar
Question 6/7: An external JavaScript must contain the <script> tag?
• yes60%bar
• no40%bar
Question 7/7: How can you add a comment in a JavaScript?
• //This is a comment20%bar
• <!-- This is a comment -->40%bar
• 'This is a comment 20%bar
• "This is a comment 20%bar

Click here to return to the main page