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