Q1. Your HTML5 code includes this code segment:
Which JavaScript code fragment will determine that a visitor has selected the "Chocolate" radio button?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q2. Which CSS3 code fragment styles an H2 element only if it is a direct child of a DIV element?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q3. Which JavaScript method is used to draw a circle on a canvas?
A. ellipse
B. circle
C. bezierCurveTo
D. arc
Answer: D
Q4. Which HTML5 tag defines superscript text?
A. < small >
B. <script>
C. <sup>
D. <sub>
Answer: C
Q5. Which two code fragments represent ways to use HTML5 to save values to session storage? (Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A,C
Explanation: Example: sessionStorage.setItem("key", "value");
Example:
if (sessionStorage.clickcount)
{
sessionStorage.clickcount=Number(sessionStorage.clickcount)+1;
}
else
{
sessionStorage.clickcount=1;
}
document.getElementById("result").innerHTML="You have clicked the button " +
sessionStorage.clickcount + " time(s) in this session.";
Q6. In HTML5, which two objects in the Web Storage specification are used to store data on the client? (Choose two.)
A. websocket
B. navigator
C. cache
D. sessionStorage
E. localStorage
Answer: D,E
Explanation: There are two new objects for storing data on the client:
localStorage - stores data with no expiration date sessionStorage - stores data for one session
Q7. Which three technologies does HTML5 encompass? (Choose three.)
A. CSS
B. ASP.NET
C. C#
D. JavaScript
E. HTML
Answer: A,D,E
Explanation: * HTML5 has full CSS3 Support.
* While developing HTML5 some rules were established including:
New features should be based on HTML, CSS, DOM, and JavaScript
Q8. Which CSS3 code segment styles the text color of EM elements to be red and semi-transparent?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q9. Your code includes the following fragment:
<input type="text" name="text1" id="myText" />
You need to add code that will retrieve the contents of the INPUT element.
Which JavaScript code fragment will accomplish this?
A. vartxtContents =document.getElementById('text1').value;
B. vartxtContents = document.getEIementyById('myText').value;
C. vartxtContents =document.getElementById('text1');
D. vartxtContents = document.getElementById('myText');
Answer: B
Q10. You need to use JavaScript to access the "section1" element in the following code fragment:
<div id='section1'>
Which method should you use?
A. getElementsByTagName
B. getElementById
C. getElementsByName
D. getElementsByClassName
Answer: B