Q1. You are developing a web form that includes the following code.
When a user selects the check box, an input text box must be added to the page dynamically.
You need to ensure that the text box is added.
Which function should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q2. 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
Q3. You are developing a customer contact form that will be displayed on a page of a company's website. The page collects information about the customer.
If a customer enters a value before submitting the form, it must be a valid email address.
You need to ensure that the data validation requirement is met.
What should you use?
A. <input name="email" type="url"/>
B. <input name="email" type="text" required="required"/>
C. <input name="email" type="text"/>
D. <input name="email" type="email"/>
Answer: D
Q4. You are developing an HTML page that includes the following code.
<h1 id="header">A Static Page</hl>
You need to modify the content of the HI element dynamically by using JavaScript.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q5. You are developing an HTML5 page that has an element with an ID of picture. The page includes the following HTML.
You need to move the picture element lower on the page by five pixels.
Which two lines of code should you use? (Each correct answer presents part of the solution. Choose two.)
A. document.getEIementById("picture").style.position = "relative";
B. document.getElementById("picture").style.top = "5px";
C. document.getEiementById("picture").style.top = "-5px";
D. document.getEIementById("picture").style.position = "absolute";
Answer: AB
Q6. You are developing a page that includes text and an illustration. The web page resembles the following image.
You have the following requirements:
The illustration must be in the center of the page.
The text must flow around the left, right, top, and bottom of the illustration.
You need to ensure that the layout of the web page meets the requirements.
Which line of code should you use?
A. -ms-wrap-side: both;
B. -ms-wrap-side: clear;
C. -ms-wrap-side: maximum;
D. -ms-wrap-side: auto;
Answer: A
Q7. You develop an HTML5 application that allows users to upload files from their local computers.
The user interface must remain responsive during the upload.
You need to implement the file upload functionality for the application.
Which two actions should you perform? (Each correct answer presents a complete solution. Choose two.)
A. Use an HTML form with a file type INPUT element that targets a hidden IFRAME element.
B. Use a file type INPUT element, and then use the Web Storage API to upload the file.
C. Use a FormData object and upload the file by using XMLHttpRequest.
D. Register the file protocol by using protocol handler registration API and then upload the file by using XMLHttpRequest.
E. Use the FileSystem API to load the file, and then use the jQuery post method to upload the file to the server.
Answer: BD
Q8. You are developing an HTML5 web page.
The appearance of the text box must change when a user moves the focus to another element on the page.
You need to develop the page to respond to user action.
Which line of code should you use?
A. <input type="text" onblur="resetStyle(this);" />
B. <input type="text" onfocus="resetStyle(this);" />
C. <input type="text" onreset="resetStyle(this);" />
D. <input type="text" onselect="resetStyle(this);" />
Answer: A
Q9. You develop a webpage by using HTML5. You create the following markup and code: (Line numbers are included for reference only.)
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A