Name:     ID: 
 
Email: 

JavaScript Programming Final Exam

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 1. 

What is the correct syntax for referring to an external script called "myScript.js"?
a.
<script src="myScript.js">
c.
<script name="myScript.js">
b.
<script href="myScript.js">
 

 2. 

Which of the following HTML tags is the largest heading?
a.
<h1>
c.
<h5>
b.
<h6>
d.
<h4>
 

 3. 

Which is the correct CSS syntax?
a.
body {color: black;}
c.
{body;color:black;}
b.
{body:color=black;}
d.
body:color=black;
 

 4. 

Use the correct Math method to return the a decimal number between 0 (inclusive) and 1 (exclusive)?
a.
Math.random( )
c.
Math.floor( )
b.
Math.ceil( )
d.
Math.PI
 

 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.pop( )
d.
locations.unshift( )
 

 6. 

What is the HTML tag to create a hyperlink?
a.
<a>
c.
<hr>
b.
<img>
d.
<target>
 

 7. 

What will be displayed in the <p> element?

<p id="demo"></p>

<script>
       var x = 10;
        x += 5;
        document.getElementById("demo").innerHTML = x;
</script>
a.
10
c.
15
b.
105
d.
5
 

 8. 

How do you write “Hello Word” in an alert box?
a.
alert(“Hello World”);
c.
alertBox(“Hello World”)
b.
msgBox(“Hello World”);
d.
msg(“Hello World”);
 

 9. 

Which of the following JavaScript statements use arrays?
a.
k = a ^ i
c.
k = a >> i
b.
k = a(i)
d.
k = a[i]
 

 10. 

Choose the correct comparison operator to alert true, when x is NOT equal to y.
a.
< >
c.
==
b.
!=
 

 11. 

Which of the following variable names is not valid?
a.
carName
c.
car_name
b.
car name
d.
$carname
 

 12. 

Which property is used to change the font of an element?
a.
font-family
c.
font-style
b.
font-weight
 

 13. 

Which property is used to change the background color?
a.
background-color
c.
bgcolor
b.
color
 

 14. 

What is the HTML tag to display an image?
a.
<image>
c.
<img>
b.
<picture>
d.
<pic>
 

 15. 

Which HTML tag is used to define an internal style sheet?
a.
<css>
c.
<script>
b.
<style>
 



 
         Start Over