Microsoft Programming in HTML5 with JavaScript and CSS3 (70-480) Free Practice Test
Question 1
You have the following HTML Markup.

You need to ensure that the markup conforms to W3C accessibility standards.
What should you add to the markup?

You need to ensure that the markup conforms to W3C accessibility standards.
What should you add to the markup?
Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 2
You are developing a web application that uses web workers to process images extracted from an HTML5 CANVAS object on a web page.
You need to pass messages between the web workers and the web page.
Which three types of objects should you use? (Each correct answer presents a complete solution. Choose three.)
You need to pass messages between the web workers and the web page.
Which three types of objects should you use? (Each correct answer presents a complete solution. Choose three.)
Correct Answer: A,B,C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
You are implementing a web worker by using JavaScript and HTML5. The web worker processes a long-running loop and returns the result to a webpage.
The web worker is defined on the webpage as follows:

You have the following requirements:
* Evaluate the message value in the web worker.
* Process the loop based on the iterations value that is passed from the webpage.
* Return a value back to the webpage from the web worker.
You need to implement the web worker.
How should you complete the relevant code? (To answer, drag the appropriate code segment to the correct location or locations in the answer area. Use only code segments that apply.)

The web worker is defined on the webpage as follows:

You have the following requirements:
* Evaluate the message value in the web worker.
* Process the loop based on the iterations value that is passed from the webpage.
* Return a value back to the webpage from the web worker.
You need to implement the web worker.
How should you complete the relevant code? (To answer, drag the appropriate code segment to the correct location or locations in the answer area. Use only code segments that apply.)

Correct Answer:

Explanation
Box 1:

Box 2:

Box 3:

Note:
* The event object for a message event supports the following additional properties:
the data property contains the message,
the origin property retrieves the scheme, hostname and port of the document that invoked the postMessage method, the source property refers to the window object that contains the document that invoked the postMessage method, the lastEventId property returns the identifier of the last message.
Question 4
You are implementing an application by using HTML5 and JavaScript. A web page contains the following HTML table.

The application must:
* Identify all rows in the table body that have a class attribute of selected
* Exclude the last selected row in the table
You need to implement the web page according to the requirements.
Which CSS selector should you use?

The application must:
* Identify all rows in the table body that have a class attribute of selected
* Exclude the last selected row in the table
You need to implement the web page according to the requirements.
Which CSS selector should you use?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 5
You create the following JavaScript code:

You must complete the ShowCanWeAfford() function:
* Display the message Denied! If the PaymentAmount variable is greater than 500.
* Display the message Approved! If the PaymentAmount variable is less than 300.
* Display the message Approved with caution! If the PaymentAmount variable is less than 500 and greater than 300.
You need to add statements to the ShowCanWeAfford() JavaScript function to meet the requirements.
Which three actions should you perform in sequence? (Develop the solution by selecting the required code segments and arranging them in the correct order.)


You must complete the ShowCanWeAfford() function:
* Display the message Denied! If the PaymentAmount variable is greater than 500.
* Display the message Approved! If the PaymentAmount variable is less than 300.
* Display the message Approved with caution! If the PaymentAmount variable is less than 500 and greater than 300.
You need to add statements to the ShowCanWeAfford() JavaScript function to meet the requirements.
Which three actions should you perform in sequence? (Develop the solution by selecting the required code segments and arranging them in the correct order.)

Correct Answer:

Explanation
Box 1:

Box 2:

Box 3:

Note:
Use > for greater than comparison.
Use < for less than comparison.
Question 6
You have the following markup.

For each of the following statements, select yes if the statement is true. Otherwise, select No.


For each of the following statements, select yes if the statement is true. Otherwise, select No.

Correct Answer:

Explanation

Question 7
You develop a webpage.
The layout of the webpage must resemble the following image:

You need to ensure that the page renders properly.
How should you complete the relevant CSS styles? (To answer, select the appropriate option from each drop-down list in the answer area.)


The layout of the webpage must resemble the following image:

You need to ensure that the page renders properly.
How should you complete the relevant CSS styles? (To answer, select the appropriate option from each drop-down list in the answer area.)


Correct Answer:

Explanation

* position: relative
The element is positioned relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT position
* position: absolute
The element is positioned relative to its first positioned (not static) ancestor element Reference: CSS position Property
Question 8
You are creating a rotating image of a company logo.
The logo must spin on a horizontal axis and on a vertical axis.
You need to use the least amount of development effort to meet the requirement.
What should you do?
The logo must spin on a horizontal axis and on a vertical axis.
You need to use the least amount of development effort to meet the requirement.
What should you do?
Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 9
You have the following code:

The web service returns a JSON object that contains two properties named Description and FileName.
The PersonImage object must meet the following requirements:
* Create an object that represents an image that will be displayed.
* Set the image properties from the values that are returned by the web service.
* Expose the image as a property of the PersonImage object.
You need to insert code at line 13 to complete the implementation of the PersonImage object.
Which three actions should you perform in sequence to complete the implementation? (Develop the solution by selecting the required code segments and arranging them in the correct order.)


The web service returns a JSON object that contains two properties named Description and FileName.
The PersonImage object must meet the following requirements:
* Create an object that represents an image that will be displayed.
* Set the image properties from the values that are returned by the web service.
* Expose the image as a property of the PersonImage object.
You need to insert code at line 13 to complete the implementation of the PersonImage object.
Which three actions should you perform in sequence to complete the implementation? (Develop the solution by selecting the required code segments and arranging them in the correct order.)

Correct Answer:

Explanation
Box 1: var img = document.createElement('img');
Box 2: img:alt = image.Description;
img src = image.FileName;
Box 3: return this.img;
Note:
* Image Object
The Image object represents an embedded image.
For each <img> tag in an HTML document, an Image object is created.
Notice that images are not technically inserted into an HTML page, images are linked to HTML pages. The
<img> tag creates a holding space for the referenced image.
* Image Object Properties include
alt, Sets or returns the value of the alt attribute of an image
src, Sets or returns the value of the src attribute of an image
Question 10
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? (Each correct answer presents a complete solution.
Choose two.)
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? (Each correct answer presents a complete solution.
Choose two.)
Correct Answer: B,D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 11
You are developing a web application by using HTML5.
You have the following requirements.
* The color of a menu item must change when a user hovers over the item.
* The color of the menu item must change back to its original color after five seconds.
You need to ensure that the animation is applied to all menu items.
Which CSS3 code should you use?

You have the following requirements.
* The color of a menu item must change when a user hovers over the item.
* The color of the menu item must change back to its original color after five seconds.
You need to ensure that the animation is applied to all menu items.
Which CSS3 code should you use?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 12
You are developing an application that processes order information. Thousands of orders are processed daily.
The application includes the following code segment. (Line numbers are included for reference only.)

The application must:
* Display the number of orders processed and the number of orders remaining
* Update the display for every 25th record processed
You need to develop the application to meet these requirements.
Which line of code should you insert at line 04?
The application includes the following code segment. (Line numbers are included for reference only.)

The application must:
* Display the number of orders processed and the number of orders remaining
* Update the display for every 25th record processed
You need to develop the application to meet these requirements.
Which line of code should you insert at line 04?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 13
You are developing a web page that includes the following HTML.

You need to ensure that the email element is enabled only if the user selects the IT Support check box.
Which CSS selectors should you use? (To answer, drag the appropriate selector to the correct location. Each selector 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.)


You need to ensure that the email element is enabled only if the user selects the IT Support check box.
Which CSS selectors should you use? (To answer, drag the appropriate selector to the correct location. Each selector 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.)

Correct Answer:

Explanation

The disabled property sets or returns whether an email field should be disabled, or not.
A disabled element is unusable and un-clickable. Disabled elements are usually rendered in gray by default in browsers.
Example
Disable an email field:
document.getElementById("myEmail").disabled = true;
Reference: Input Email disabled Property
Question 14
You have the following HTML markup

You need to create a style so that the text "to this site" is displayed in blue.
Which markup should you use?

You need to create a style so that the text "to this site" is displayed in blue.
Which markup should you use?
Correct Answer: A