Q1. You are developing a web page that includes the following HTML. <span id="myTextSpan" class="myStyle">Hello, World!</Span> You need to use inline CSS styling to format the text with Arial font. Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q2. You are modifying a blog site to improve search engine readability.
You need to group relevant page content together to maximize search engine readability.
Which tag should you use?
A. <nav>
B. <article>
C. <span>
D. <div>
Answer: B
Q3. You are developing an HTML5 web application. The application loads data from a web service by using AJAX. The application displays the data by calling the displayData function. The data is loaded by using the following code.
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q4. An HTML page contains no embedded JavaScript or CSS code. The body of the page contains only the following line of code.
<p id="test">test</p> A CSS style sheet must be applied dynamically. The style must visibly change the appearance of the paragraph on the page.
You need to apply a style the paragraph.
Which line of code should you use?
A. document.getElementById("test").style.border = "0";
B. document.getElementById("test").style.position = "static";
C. document.getElementById ("test").style.padding = "15px";
D. document.getElementById("test").style.top = "5px";
Answer: A
Q5. You develop an HTML application that contains a table that displays a list of products. The table is defined with the following HTML markup:
You need to implement the CSS selectors to select the rows that must have a blue background.
Which CSS selector should you use?
A. thead:only-child, tbody:after, table:before
B. tr [line |-0, 1, 3]
C. tr:first-of-type, tr:last-of-type
D. tr:first-line, tr:last-child
Answer: B
Q6. You are troubleshooting a web page that includes the following code. (Line numbers are included for reference only.)
What is displayed in the alert from line 11?
A. Div
B. Function
C. Button
D. Document
Answer: C
Q7. You are developing an application that uses a third-party JavaScript library named doWork().
The library occasionally throws an "object is null or undefined" error with an error code of -2146823281.
The application must:
. Extract and handle the exceptions thrown by doWork()
. Continue normal program execution if other exceptions occur You need to implement the requirements.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q8. You are creating a custom object as described by the following code.
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q9. You create an application that sends information to a web service by using the following code: (Line numbers are included for reference only.)
When the web service returns a non-zero result code, you must raise an exception that contains the result code.
You need to implement the code that generates the exception.
Which line of code should you insert at line 04?
A. CustomError .prototype = Error.prototype;
B. CustomError ["ErrorType"] = Error;
C. CustomError.customError = true;
D. Error-constructor = CustomError;
Answer: A
Q10. You are creating a class named Consultant that must inherit from the Employee class. The Consultant class must modify the inherited PayEmployee method. The Employee class is
defined as follows.
function Employee() {}
Employee.prototype.PayEmployee = function ( ){
alertt'Hi there!');
}
Future instances of Consultant must be created with the overridden method.
You need to write the code to implement the Consultant class.
Which code segments should you use? (Each correct answer presents part of the solution. Choose two.)
A. Consultant.PayEmployee = function ()
{
alert('Pay Consulant');
}
B. Consultant.prototype.PayEmployee = function ()
{
alert('Pay Consultant');
}
C. function Consultant () {
Employee.call(this);
}
Consultant.prototype = new Employee();
Consultant.prototype.constructor = Consultant;
D. function Consultant() {
Employee.call(this); }
Consultant.prototype.constructor = Consultant.create;
Answer: BC
Q11. You are developing a web page that consumes a Windows Communication Foundation (WCF) service. The page includes the following code segment.
var xhr = new XMLHttpRequest() ;
The page uses the xhrHandler() method to listen for changes to the request status of the WCF service calls. It uses the xmlToJavaScript() method to convert the response from the WCF service to a JavaScript object.
The xhrHandler() method must be called automatically each time the request status changes.
You need to add the event handler to the request object.
Which line of code should you use?
A. xhr.onCallback = xhrHandler;
B. xhr.onreadystatechange = xhrHandler;
C. xhr.readyState = xhrHandler;
D. xhr.status = xhrHandler;
Answer: B
Q12. You develop an HTML5 webpage that contains the following HTML markup:
You have the following requirements:
. Retrieve the content for any OPTION elements when the value of the selected attribute equals selected. . Add the content to a comma separated string.
You need to retrieve the required data.
Which two code segments should you add to the webpage? (Each correct answer presents a complete solution. Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: BD
Q13. You are creating a JavaScript object that represents a customer.
You need to extend the Customer object by adding the GetCommission() method.
You need to ensure that all future instances of the Customer object implement the GetCommission() method.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q14. You are modifying a blog site to improve search engine readability.
You need to group relevant page content together to maximize search engine readability.
Which tag should you use?
A. <section>
B. <tbody>
C. <div>
D. <table>
Answer: A
Q15. You are developing an HTML5 web application and are styling text.
You need to use the text-transform CSS property.
Which value is valid for the text-transform property?
A. Capitalize
B. Red
C. 20px
D. Italic
Answer: A