Multiple Choice Identify the
choice that best completes the statement or answers the question.
|
|
1.
|
What will be displayed in the <p> element?
<p
id="demo"></p>
<script> var x
= 10; x +=
5; document.getElementById("demo").innerHTML
= x; </script>
|
|
2.
|
Use the correct Math method to return the a decimal number between 0 (inclusive)
and 1 (exclusive)?
a. | Math.ceil( ) | c. | Math.floor( ) | b. | Math.PI | d. | Math.random( ) |
|
|
3.
|
Which HTML tag is used to define an internal style sheet?
a. | <script> | c. | <css> | b. | <style> |
|
|
4.
|
How do you write “Hello Word” in an alert box?
a. | msgBox(“Hello World”); | c. | alertBox(“Hello
World”) | b. | msg(“Hello World”); | d. | alert(“Hello
World”); |
|
|
5.
|
Use the correct Array method to remove the last item of the locations
array? var locations = [“North”, “South”, “East”,
“West”];
a. | locations.push( ) | c. | locations.shift( ) | b. | locations.unshift( ) | d. | locations.pop(
) |
|
|
6.
|
Choose the correct comparison operator to alert true, when x is NOT equal to
y.
|
|
7.
|
What is the HTML tag to display an image?
a. | <img> | c. | <picture> | b. | <image> | d. | <pic> |
|
|
8.
|
Which property is used to change the font of an element?
a. | font-weight | c. | font-family | b. | font-style |
|
|
9.
|
Which property is used to change the background color?
a. | background-color | c. | color | b. | bgcolor |
|
|
10.
|
Which of the following HTML tags is the largest heading?
|
|
11.
|
What is the correct syntax for referring to an external script called
"myScript.js"?
a. | <script href="myScript.js"> | c. | <script
src="myScript.js"> | b. | <script
name="myScript.js"> |
|
|
12.
|
Which is the correct CSS syntax?
a. | body {color: black;} | c. | {body:color=black;} | b. | body:color=black; | d. | {body;color:black;} |
|
|
13.
|
What is the HTML tag to create a hyperlink?
a. | <img> | c. | <a> | b. | <target> | d. | <hr> |
|
|
14.
|
Which of the following JavaScript statements use arrays?
a. | k = a >> i | c. | k = a(i) | b. | k = a ^ i | d. | k =
a[i] |
|
|
15.
|
Which of the following variable names is not valid?
a. | $carname | c. | car_name | b. | car name | d. | carName |
|