Microsoft Programming in HTML5 with JavaScript and CSS3 (070-480) Free Practice Test
Question 1
Which CSS3 code segment styles the text color of EM elements to be red and semi-transparent?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 2
You are developing an application in HTML5.
You have the following HTML markup.

You have the following JavaScript code.

Use the drop-down lists to select the answer choice that completes each statement.

You have the following HTML markup.

You have the following JavaScript code.

Use the drop-down lists to select the answer choice that completes each statement.

Correct Answer:

Explanation

Question 3
An HTML page has a canvas element.
You need to draw a red rectangle on the canvas element dynamically. The rectangle should resemble the following graphic.

How should you build the code segment? (To answer, select the appropriate options from the drop-down lists in the answer area.)


You need to draw a red rectangle on the canvas element dynamically. The rectangle should resemble the following graphic.

How should you build the code segment? (To answer, select the appropriate options from the drop-down lists in the answer area.)


Correct Answer:

Explanation

* getElementById
The getElementById() method accesses the first element with the specified id. We use it to get a reference to the canvas.
* context.fillStyle.
Example:
Define a red fill-color for the rectangle:
JavaScript:
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="#FF0000";
ctx.fillRect(20,20,150,100);
Reference: HTML canvas fillStyle Property
Question 4
You develop an HTML5 webpage. You have the following HTML markup:
<input type="text" id="username" />
You need to prevent users from entering specific characters into the username field.
What should you do?
<input type="text" id="username" />
You need to prevent users from entering specific characters into the username field.
What should you do?
Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 5
You are developing an HTML5 web form to collect feedback information from site visitors.
The web form must display an INPUT element that meets the following requirements:
* Allow numeric values between 1 and 10.
* Default to the value of 5.
* Display as a slider control on the page.
You need to add the INPUT element to the form.
Which HTML element should you add?
The web form must display an INPUT element that meets the following requirements:
* Allow numeric values between 1 and 10.
* Default to the value of 5.
* Display as a slider control on the page.
You need to add the INPUT element to the form.
Which HTML element should you add?
Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
You are troubleshooting an application. Users report that the UI is slow to respond. You need to improve UI responsiveness by moving application tasks to web workers.
Which two tasks can you move to achieve this goal? (Choose Two)
Which two tasks can you move to achieve this goal? (Choose Two)
Correct Answer: C,D
Question 7
Which CSS3 code fragment will style only the external links in an HTML document?
Correct Answer: C
Question 8
You have the following code.

You discover that the displayGlobalProduct function displays a value of boat.
You need to change the function to display a value of car.
Which line of code can you use to replace the alert?

You discover that the displayGlobalProduct function displays a value of boat.
You need to change the function to display a value of car.
Which line of code can you use to replace the alert?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 9
You are developing an HTML5 web application that provides a discussion forum for users. When a user registers to access the application, the user enters an email address.
Users can enter data that can result in cross-site scripting (XSS) attacks.
You need to ensure that email input is as secure as possible.
Which two techniques should you use? (Each correct answer presents a complete solution. Choose two.)
Users can enter data that can result in cross-site scripting (XSS) attacks.
You need to ensure that email input is as secure as possible.
Which two techniques should you use? (Each correct answer presents a complete solution. Choose two.)
Correct Answer: B,C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 10
You are creating an application by using HTML5 and CSS3. The styles for the pages are derived from five style sheets.
The styles are not being applied correctly to the pages in the application.
You need to determine the order in which the style sheets will be applied by the browser.
In which order will the five style sheets be applied? (To answer, move the style sheet types from the list of style sheet types to the answer area and arrange them in the order that they will be applied.)

The styles are not being applied correctly to the pages in the application.
You need to determine the order in which the style sheets will be applied by the browser.
In which order will the five style sheets be applied? (To answer, move the style sheet types from the list of style sheet types to the answer area and arrange them in the order that they will be applied.)

Correct Answer:

Explanation
Box 1: user agent style sheets
Box 2: user normal style sheets
Box 3 author normal style sheets:
Box 4: author important style sheets
Box 5: user important style sheets
Note:
The order of declarations from least important to most important:
* user agent declarations
* user normal declarations
* author normal declarations
* author important declarations
* user important declarations
Question 11
You are developing a page by using HTML5 and CSS3.
You need to ensure that the page meets the following requirements:
* The page must resize automatically for proper viewing on a variety of devices, such as desktop computers, mobile phones and tablets.
* The text "Ben Smith" must appear on the same line without splitting around the other HTML elements.
How should you complete the markup? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.

You need to ensure that the page meets the following requirements:
* The page must resize automatically for proper viewing on a variety of devices, such as desktop computers, mobile phones and tablets.
* The text "Ben Smith" must appear on the same line without splitting around the other HTML elements.
How should you complete the markup? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation

Box 1: box-sizing: border-box
Box 2: display: inline
Reference: https://www.w3schools.com/CSSref/pr_class_display.asp
Question 12
You have a page that uses HTML5 and CSS3. The page contains the following markup.
What is the background color of each link when the page renders? To answer, drag the appropriate colors to the correct locations. Each color may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.

What is the background color of each link when the page renders? To answer, drag the appropriate colors to the correct locations. Each color may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation

Question 13
You are developing an e-commerce website. Users place products into a shopping cart.
You need to ensure that the shopping cart data is available between browser sessions.
Which object should you use to store the shopping cart data?
You need to ensure that the shopping cart data is available between browser sessions.
Which object should you use to store the shopping cart data?
Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).