Q1. 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
Q2. You develop an HTML5 webpage. You have the following HTML markup:
You need to change the background color for all of the elements whose name attribute ends with the word name.
Which code segment should you add to the webpage?
A. $ ('#name').css ({ 'background-color' : '#E0ECF8' });
B. $ ('input [name |="name"; ] ' ) .css (( 'background-color' : '#E0ECF8'});
C. $('input[name$="name"]'). css{{'background-color' : '#E0ECF8'});
D. $ ('*name' ) .css ({ 'background-color' : ' #E0ECF8'}) ;
Answer: C
Q3. You develop an HTML5 web application. The web application contains a form that allows users to enter only their month of birth.
The value that the users enter must be numbers between 1 and 12, inclusive.
You need to implement the form element for the month of birth.
Which element should you use?
A. <input type="time" options="month" />
B. <input types="submit" value="month" />
C. <input type="range" min="1" max="12" />
D. <input type="month" itemscope="numeric" />
Answer: C
Q4. You are developing an HTML5 web application for an architectural company that displays architectural blueprints.
The application must:
Display the blueprints at different zoom levels without loss of detail Print the blueprints without loss of detail Work from only one source file per blueprint
You need to ensure that blueprints display according to the requirements.
Which HTML5 element should you use?
A. CANVAS
B. SAMP
C. SVG
D. AREA
Answer: C
Q5. You need to test the value of the following variable in JavaScript.
var length = "75";
A block of code must execute if the length equals 75 regardless of the data type.
You need to use the statement that meets this requirement.
Which lines of code should you use? (Each correct answer presents a complete solution. Choose two.)
A. if (length = = = 75)
B. if (length = = 75)
C. if (length! = 75)
D. if (length = = "75")
Answer: BD
Q6. You are developing a customer web form that includes the following HTML.
<input id="txtValue"/>
You need to change the HTML markup so that customers can enter only a valid three-letter country code.
Which HTML should you use?
A. <input id="txtValue" type="code" />
B. <input id="txtValue" type="text" pattern=" [A-Za-z] {3}" />
C. <input id="txtValue" type="text" required="required"/>
D. <input id="txtValue" type="country" />
Answer: B
Q7. You are developing an application that analyzes population data for major cities in the United States. The application retrieves population statistics for a city by using a web service.
You need to request data from the web service by using jQuery.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q8. You develop an HTML5 application. You give users a numeric access code that can be used only one time.
Users must enter the numeric access code in the login form of the application. The numeric characters must be hidden by a masking character.
You need to implement the form element for users to enter the code. Which HTML element should you use?
A. <input type="password" required autocomplete="off">
B. <input type="input" autocomplete="off" required />
C. <input type="password" stytem" visiblity:hidden;" required />
D. <input type="button" value="password" required />
Answer: A
Q9. You develop a webpage with a standard input control by using HTML5.
The input control must display the text Enter your given name, as shown below:
When a user selects the input control, the text must disappear.
You need to create the input control.
Which input control should you use?
A. <input name="GivenName" value=" Enter your given name" />
B. <input name ="GivenName" default=" Enter your given name" />
C. <input name="GivenName" text=" Enter your given name" />
D. <input name="GivenName" placeholder=" Enter your given name" />
Answer: D
Q10. 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
Q11. You are building a web page for a newspaper publisher.
. You have the following requirements:
. The web page should split the content into columns that are at least 100 pixels wide.
. The number of columns displayed must be set by the browser.
You need to implement the correct CSS properties.
Which line of code should you use?
A. <div id="outer" style="width: 100px; column-fill: balance;">...</div>
B. <div id="outer" style="width: 100px; column-gap: 10px;">...</div>
C. <div id="outer" style="column-width: 100px; ">. . .</div>
D. <div id="outer" style="width: 100px; columns: 100px 3">...</div>
Answer: C
Q12. 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
Q13. You are creating a JavaScript function to display the current version of a web application
You declare a button as follows.
<input type="button" id="About" value="About" />
You need to create an event handler for the button by using an anonymous function.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q14. 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
Q15. You develop an HTML5 application that interacts with a REST service. The REST service accepts JSON data. A JavaScript object named form Data contains data that is sent to the REST service.
You need to convert the JavaScript object named formData into JSON.
Which code segment should you use?
A. jQuery.ajax.valueOf(formData);
B. window.evai(formData);
C. JSON.stringify (formData);
D. formData.toString();
Answer: C