1 .ac.id



1. |Inside which HTML element do we put the JavaScript? | |

| |

| |

| |

| * |

| 2. |What is the correct JavaScript syntax to write "Hello World"? |

|response.write("Hello World") |

|document.write("Hello World") * |

|("Hello World") |

|"Hello World" |

|3. |Where is the correct place to insert a JavaScript? |

|Both the section and the section are correct * |

|The section |

|The section |

| 4. |What is the correct syntax for referring to an external script called "xxx.js"? |

| |

| |

| * |

|5. |An external JavaScript must contain the tag |

|True |

|False * |

| 6. |How do you write "Hello World" in an alert box? |

|msgBox("Hello World") |

|alertBox="Hello World" |

|alertBox("Hello World") |

|alert("Hello World") * |

|7. |How do you create a function? |

|function:myFunction() |

|function=myFunction() |

|function myFunction() * |

|8. |How do you call a function named "myFunction"? |

|myFunction() * |

|call myFunction() |

|call function myFunction |

|9. |How do you write a conditional statement for executing some statements only if "i" is equal to 5? |

|if i=5 |

|if i==5 then |

|if (i==5) * |

|if i=5 then |

|10. |How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5? |

|if 5 |

|if (i 5) |

|if (i != 5) * |

|if =! 5 then |

|11. |How many different kind of loops are there in JavaScript? |

|One. The "for" loop |

|Four. The "for" loop, the "while" loop, the "do...while" loop, and the "loop...until" loop |

|Two. The "for" loop and the "while" loop * |

|12. |How does a "for" loop start? |

|for i = 1 to 5 |

|for (i ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download