Sample Questions

advertisement
SAMPLE QUESTIONS
1. Look at the partial code below and fill in the blank with a single-line comment that contains
today’s date using MM/DD/YYYY format.
<script>
_________________________________________
alert(“Hello World!”);
</script>
2. Write the code to use an image, “google.jpg”, to create an image link and link it to www.
google.com. (Assume all files are in the same folder)
3. Name two pop up boxes in JavaScript.
4. There are three types of style sheets, what are they?
5. Write JavaScript code to declare a variable named age and assign it a numeric value 12.
6. Write an internal/embedded style to set the font color of an h1 element to #FFFCCC. Put
it in the appropriate tags.
7. Fill in the blank below to change the background color of this p element to black when
you click on it.
<p onclick =
>Content of this paragraph</p>
8. Circle all of the valid id names:
a. 2013 b. year c. year2013 d. year_2013 e. year 2013
9. Write the code in the empty space below to create this list. No CSS styles needed.



Spain
France
1. Lyon
2. Paris
Italy
10. (A) Write the image element for the image lion.jpg which is in folder All_Images.
(B) What are the two mandatory attributes for an image element? List the attribute
keywords(names) only.
11. Correct the code below to make the code correct and fully HTML5 compliant. Please fill
in or cross out, draw arrows and re-write small pieces of code. Do not rewrite the
entire code or any text, only the code corrections.
<!DOCTYPE html>
<html lang=“en">
<head>
<meta charset="utf-8">
<h1> Can you find the errors? </h1>
<img src=“me.jpg" alt=“my_pic">
<style> p {color: blue;}
</head>
<title> Technology News </title>
<body>
<h1 style=”font-color: blue”>Google Leapfrogs Microsoft in Market Value</h3>
<h3>By NICK WINGFIELD<h3>
<p> <i>For Microsoft, it was bad enough when Apple's stock market value
surpassed its own in 2010. Now Google, a company that didn't even exist 15 years
ago, just did the same thing.</p></i>
</body>
</html>
12. Fill the blanks below and use a single class to make the text color of both the paragraph
and h2 elements to pink.
<style>
____________________________________________
</style>
…
<h2 ___________>CSS stands for Cascading Style Sheets</h2>
<p ___________>CSS stands for Cascading Style Sheets</p>
13. Given the code below, answer the questions.
<!DOCTYPE html>
<html lang=“en">
<head>
<title> Movie Quotes </title>
<style>
body {background-image: url(All_Images/poster.jpg) }
p {color: lime; background-color: purple}
h4 {color: red}
#p3 {background-color: green}
</style>
</head>
<body>
<h4> SHAWSHANK REDEMPTION </h4>
<p id=”p1”> Let me tell you something my friend.
Hope is a dangerous thing.Hope can drive a man mad</p>
<p id=”p2”> Remember Red, hope is a good thing,
maybe the best of things, and no good thing ever dies</p>
<p id=”p3”> I believe in two things: discipline and the Bible </p>
</body>
</html>
For the h4 element:
What color will the text appear on the screen?
For paragraph with id “p1”:
a.)What is its font color (text color)?
b.)What is its background color?
For paragraph with id “p3”:
What is its background color?
14. Fill in the blanks below to create a fragment identifier for the paragraph which contains
Thomas Jefferson’s quote.
<p _______________ >
All tyranny needs to gain a foothold is for people of good conscience to remain silent.
</p>
Fill in the blanks below to write the internal link to Thomas Jefferson’s quote on the line
below. (2pts.)
Go to Thomas Jefferson’s quote.
15. Fill in the blanks below with some CSS styles to make the webpage have a background
image top.jpg. Make top.jpg run across the bottom of the page.
<style>
body{color:white; background-color:yellow;}
_______________________________________
<style>
16. Given the code below
<h2 ____________________________________________________
>
Javascript is awesome!</h2>
<p id=”jules”> Interested in learning more javascript?</p>
<p id=”vincent1”> We will learn more in the </p>
A. Explain what is an event? What is an even handler?
B. Fill in the blank above and use JavaScript event handlers to change the background
color of <h2> element to blue when you click it.
Download