Inside which html element do we put the javascript a

This preview shows page 16 - 19 out of 26 pages.

1) Inside which HTML element do we put the JavaScript? a) <js> b) <javascript> c) <scripting> d) <script>
2) What is the correct JavaScript syntax to write "Hello World"?
3) Where is the correct place to insert a JavaScript?
4) What is the correct syntax for referring to an external script called "xxx.js"?
5) An external JavaScript must contain the <script> tag False True
6) How do you write "Hello World" in an alert box?
7) How do you create a function?
8) How do you call a function named "myFunction"?
9) How do you write a conditional statement for executing some statements only if "i" is equal to 5? a) if i==5 then b) if (i==5) c) if i=5 then d) if i=5
10) How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5?
11) How many different kind of loops are there in JavaScript?
12) How does a "while" loop start ?
13) How does a "for" loop start? a) for i = 1 to 5 b) for (i = 0; i <= 5) c) for (i = 0; i <= 5; i++) d) for (i <= 5; i++)
14) How can you add a comment in a JavaScript?
15) What is the correct JavaScript syntax to insert a comment that has more
17
16) What is the correct way to write a JavaScript array?
17) How do you round the number 7.25, to the nearest whole number? a) round(7.25) b) Math.round(7.25) c) rnd(7.25) d) Math.rnd(7.25)
18) How do you find the largest number of 2 and 4?
19) What is the correct JavaScript syntax for opening a new window called "window2" ?
18

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture