Q1. 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.)
A. Remove all nonalphanumeric characters before submitting data.
B. Use the email tag in forms where the email address is entered.
C. Display all email addresses inside of an HTML5 ADDRESS element.
D. Use jQuery validation with a regular expression to ensure that email addresses are valid.
E. Ensure that all form data is encrypted when it is submitted.
Answer: BD
Q2. You troubleshoot a webpage that contains the following HTML element:
<canvas id= "clickCanvas" width-"300"> height= "300">Your browser does not support the HTML5 canvas.</canvas>
The following JavaScript code is included in a script tag in the HEAD section of the webpage: (Line numbers are included for reference only.)
You need to invoke the clickReporter() JavaScript function when a user clicks the mouse on the canvas HTML element.
What should you do?
A. Add the following attribute to the canvas HTML element: clicked= "clickReporter()"
B. Replace the code segment at line 06 with the following code segment: drawBox.Click += clickReporter;
C. Insert the following code segment at line 07: canvas.onclick = clickReporter;
D. Insert the following code segment at line 07: canvas, click = clickReporter;
Answer: B
Q3. You are developing a customer web form that includes the following HTML.
<input id="txtValue" type="text" />
A customer must enter a valid age in the text box prior to submitting the form.
You need to add validation to the control.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q4. You are developing an application to track project management for your company. The status of the project is stored in a variable named percentComplete.
The method must execute only when percentComplete is equal to the numeric value 100.
You need to develop the application to meet the requirement.
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 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
Q7. You are developing an HTML5 page. The page includes the following code.
The inner paragraph must be exactly 15 pixels from the top left corner of the outer paragraph. You set the left style for the inner paragraph to the appropriate value.
You need to set the position property of the inner paragraph.
Which value should you use?
A. absolute
B. static
C. fixed
D. relative
Answer: A
Q8. You are modifying an existing web page. The page is being optimized for accessibility. The current page contains the following HTML.
Standards-compliant screen readers must be able to identify the links contained within the navigation structure automatically.
You need to create the navigation link structure in the page.
With which container tags should you wrap the existing markup?
A. <navmap> </navmap>
B. <div id="nav"> </div>
C. <nav> </nav>
D. <map> </map>
Answer: C
Q9. You develop a webpage.
The webpage must display a grid that contains one row and five columns. Columns one, three, and five are the same width. Columns two and four are the same width, but much wider than columns one, three, and five. The grid resembles the following image:
The grid must meet the following requirements:
Each row must be tall enough to ensure that images are not cut off.
Each row must contain five columns.
The width of the columns must not change when the screen is resized or rotated.
You need to define the style for the grid. Which CSS3 style should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q10. 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. lowercase
B. 20px
C. line-through
D. italic
Answer: A