JavaScript Quiz Results #1. What is the correct JavaScript syntax to change the content of the HTML element below? This is a demonstration. document.getElementByName("p").innerHTML = "Hello World!"; #demo.innerHTML = "Hello World!"; document.getElement("p").innerHTML = "Hello World!"; document.getElementById("demo").innerHTML = "Hello World!"; #2. Where is the correct place to insert a JavaScript? The section The section Both the section and the section are correct #3. What is the correct syntax for referring to an external script called “xxx.js”? < script href="xxx.js" > < script name="xxx.js" > < script src="xxx.js" > #4. The external JavaScript file must contain the < script > tag. True False #5. How do you write “Hello World” in an alert box? msg("Hello World"); alertBox("Hello World"); msgBox("Hello World"); alert("Hello World"); #6. How do you create a function in JavaScript? function = myFunction() function:myFunction() function myFunction() #7. How does a WHILE loop start? while (i <= 10; i++) while i = 1 to 10 while (i <= 10) #8. How does a FOR loop start? for (i <= 5; i++) for (i = 0; i <= 5; i++) for i = 1 to 5 for (i = 0; i <= 5) #9. How to insert a comment that has more than one line? //This comment has more than one line// /*This comment has more than one line*/ #10. JavaScript is the same as Java. True False #11. What will the following code return: Boolean(10 > 9) NaN false true #12. Is JavaScript case-sensitive? No Yes Previous Finish