Examcollection offers free demo for 70-480 exam. "Programming in HTML5 with JavaScript and CSS3", also known as 70-480 exam, is a Microsoft Certification. This set of posts, Passing the Microsoft 70-480 exam, will help you answer those questions. The 70-480 Questions & Answers covers all the knowledge points of the real exam. 100% real Microsoft 70-480 exams and revised by experts!
Free 70-480 Demo Online For Microsoft Certifitcation:
NEW QUESTION 1
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
Explanation:
The border shorthand property sets all the border properties in one declaration.
The properties that can be set, are (in order): border-width, border-style, and border-color.
It does not matter if one of the values above are missing, e.g. border:solid #ff0000; is allowed. Reference: Style border Property
NEW QUESTION 2
You are creating a custom object as described by the following code.
You need to implement the calcArea method. Which code should you use?
- A. Option A
- B. Option B
- C. Option C
- D. Option D
Answer: D
NEW QUESTION 3
HOTSPOT
You have the following code. (Line numbers are included for reference only.)
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
No
Yes
No
https://www.w3schools.com/cssref/pr_margin-left.asp https://css-tricks.com/almanac/properties/t/transition/ https://www.w3schools.com/cssref/css3_pr_transition.asp
NEW QUESTION 4
You develop an HTML5 webpage. You have the following HTML markup:
<input type="text" id="username" />
You need to prevent users from entering specific characters into the username field. What should you do?
- A. Using the keyup event, add an anonymous function that returns true when a specific characterkeycode value is determined.
- B. Using the change event, add an anonymous function that returns true when a specific character keycode value is determined.
- C. Using the keydown event, add an anonymous function that returns false when a specific character keycode value is determined.
- D. Using the change event, add an anonymous function that returns false when a specific character keycode value is determined.
Answer: B
Explanation:
The change event is fired for <input>, <select>, and <textarea> elements when a change to the element's value is committed by the user.
Use the change event and an anonymous function to detect illegal specific characters in the input.
NEW QUESTION 5
DRAG DROP
You are developing a web page for runners who register for a race. The page includes a slider control that allows users to enter their age. You have the following requirements:
All runners must enter their age.
Applications must not be accepted from runners less than 18 years of age or greater than 90 years. The slider control must be set to the average age (37) of all registered runners when the page is first displayed.
You need to ensure that the slider control meets the requirements.
What should you do? (To answer, drag the appropriate word or number to the correct location in the answer are a. Each word or number 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.)
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
Box 1-3: The <input type="range"> is used for input fields that should contain a value within a range.
Example
<input type="range" name="points" min="0" max="10"> Box 4:
The step attribute specifies the legal number intervals for an <input> element.
Example: if step="3", legal numbers could be -3, 0, 3, 6, etc. Syntax
<input step="number"> number
Specifies the legal number intervals for the input field. Default is 1 Box 5: Use the value attribute to set the default value. Here: 37 Box 6: Definition and Usage
The required attribute is a boolean attribute.
When present, it specifies that an input field must be filled out before submitting the form. Example
Username: <input type="text" name="usrname" required> Reference: HTML Input Types http://www.w3schools.com/html/html_form_input_types.asp
NEW QUESTION 6
You have the following markup.
You need to ensure that the yellow div is centered in the red div. What should you do?
- A. Add the following code to the red di
- B. align-content:center
- C. Add the following code to the red div.Margin:auto
- D. Add the following code to the Yellow di
- E. align-content:center
- F. Add the following code to the Yellow div Margin:auto
Answer: C
NEW QUESTION 7
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. <article>
- B. <span>
- C. <tbody>
- D. <cd>
Answer: A
Explanation:
How the Changes in HTML 5 Will Affect SEO (Search Engine Optimization)?
As a SEO expert, you are most likely interested mainly in those changes in the HTML 5 specification, which will affect your work. Here is one of them:
A new <article> tag. The new <article> tag is probably the best addition from a SEO point of view. The
<article> tag allows to mark separate entries in an online publication, such as a blog or a magazine. It is expected that when articles are marked with the <article> tag, this will make the HTML code cleaner because it will reduce the need to use <div> tags. Also, probably search engines will put more weight on the text inside the <article> tag as compared to the contents on the other parts of the page.
NEW QUESTION 8
DRAG DROP
You create an HTML5 webpage. You have the following HTML markup:
You also have the following JavaScript code segment:
var jsonFruit = { "apples" : "12", "bananas" : "8", "watermelon" : "3" }
You need to add additional rows to the fruitTable element by processing the jsonFruit values in the order listed.
Which three actions should you perform in sequence? (Develop the solution by selecting the required code segments and arranging them in the correct order.)
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
NEW QUESTION 9
You develop an HTML5 webpage. You have the following JavaScript code:
You need to handle the click event when a user clicks the showDialog button. Which code segment should you insert at line 02?
- A. $ (document).trigger("click", "#showDialog", function (e) {
- B. $ (document).on ("#showDialog", "click", function (e) {
- C. $(document).toggle("click", "#showDialog", function (e) {
- D. $(document).on("click", "#showDialog", function (e) {
Answer: D
Explanation:
Syntax: .on( events [, selector ] [, data ], handler )
* Example:
$(function() {
$(document).on('click', '.get-widgets', function (e) { Reference: jQuery .on()
NEW QUESTION 10
You are developing an application that retrieves a stock rate from an external web service. A web page displays a simple rotating animation to indicate whether the stock rate is increased or decreased.
The default image, as shown in the following graphic, indicates unchanged or neutral.
The arrow must point down if the stock rate is decreased, as shown in the following graphic.
You need to ensure that the arrow points down when the stock rate decreases. Which CSS style should you apply?
- A. Option A
- B. Option B
- C. Option C
- D. Option D
Answer: D
Explanation:
transform:rotate rotate(angle)
Defines a 2D rotation, the angle is specified in the parameter Syntax: object.style.transform="rotate(7deg)"
Reference: CSS3 transform Property
NEW QUESTION 11
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.
You need to ensure that the data is displayed when it is successfully retrieved from the web service. Which code segment should you use?
- A. Option A
- B. Option B
- C. Option C
- D. Option D
Answer: B
Explanation:
The deferred.done() method accepts one or more arguments, all of which can be either a single function or an array of functions. When the Deferred is resolved, the doneCallbacks are called. Callbacks are executed in the order they were added. Since deferred.done() returns the deferred object, other methods of the deferred object can be chained to this one, including additional .done() methods.
$.ajax
Reference: JQuery, deferred.done()
NEW QUESTION 12
You are creating a web page that contains a canvas with text.
The page contains the following JavaScript code. Line numbers are included for reference only.
The text on the canvas must rotate 90 degrees when a user clicks a button on the page. You need to ensure that the text rotates when the user clicks the button.
Which line of code should you add at line 02?
- A. canvas.style.transform = “rotation(90deg)”;
- B. canvas.transform(90);
- C. canvas.content.rotate(90);
- D. canvas.style.transform = “rotate(90deg)”;
Answer: D
Explanation:
https://www.w3schools.com/jsref/prop_style_transform.asp
NEW QUESTION 13
DRAG DROP
You have the following markup.
You need to ensure that when the button is clicked, a message appears that displays the value of the button.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
NEW QUESTION 14
DRAG DROP
You are validating user input by using JavaScript and regular expressions. A group of predefined regular expressions will validate two input fields:
An email address in a function named validateEmail (for example, firstname@contoso.com)
A nine-digit number that allows optional hyphens after the second and fifth character in a function named validateSSN(for example, 555555555 or 555-55-5555)
You need to use the correct expression to validate the input.
Which expression should you insert into each function? (To answer, drag the appropriate regular expression statement to the correct location. Each regular expression statement 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.)
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
NEW QUESTION 15
DRAG DROP
You need to write a jQuery function to consume a file named Orders.xml. You write the following code.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer are a. Each code element 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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References:
https://github.com/processing/p5.js/wiki/Loading-external-files:-AJAX,-XML,-JSON
NEW QUESTION 16
HOTSPOT
You have the following markup.
You need to create a single JSON object that directly contains the values from personForm and sends the object to a Web server API. The contents of the JSON object must have the format shown in the following sample.
How should you complete the JavaScript code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
var personalFormData = $(“#personForm”).serialize(submitPersonForm);
NEW QUESTION 17
DRAG DROP
You have the following markup:
You need to complete the styles to meet the following requirements:
How should you complete the styles? To answer, drag the appropriate code elements to the correct targets in the answer are a. Each code element 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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
Target 1: Flex
Target 2: 1
Target 3: Flex
Target 4: 2
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
NEW QUESTION 18
You have the following code:
You need to convert objStr into an array. Which line of code should you use?
- A. var jsObject = Array.bind(objStr);
- B. var jsObject = Array.valueOf(objStr);
- C. var jsObject = JSON.parse(objStr);
- D. var jsObject = $.makeArray(objStr);
Answer: C
Explanation:
https://www.w3schools.com/js/js_json_parse.asp
NEW QUESTION 19
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. <tbody>
- B. <article>
- C. <div>
- D. <span>
Answer: B
Explanation:
The <article> tag specifies independent, self-contained content.
An article should make sense on its own and it should be possible to distribute it independently from the rest of the site.
Potential sources for the <article> element: Forum post
Blog post
News story Comment
NEW QUESTION 20
HOTSPOT
An HTML page has a canvas element.
You need to draw a red rectangle on the canvas element dynamically. The rectangle should resemble the following graphic.
How should you build the code segment? (To answer, select the appropriate options from the drop- down lists in the answer area.)
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
* getElementById
The getElementById() method accesses the first element with the specified id. We use it to get a reference to the canvas.
* context.fillStyle. Example:
Define a red fill-color for the rectangle: JavaScript:
var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle="#FF0000"; ctx.fillRect(20,20,150,100);
Reference: HTML canvas fillStyle Property
NEW QUESTION 21
DRAG DROP
You are creating an application by using HTML5 and CSS3. The styles for the pages are derived from
five style sheets.
The styles are not being applied correctly to the pages in the application. You need to apply the styles from highest priority to lowest priority.
In which order should you use the five style sheets? (To answer, move the style sheet types from the list of style sheet types to the answer area and arrange them in the correct order.)
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
* From highest priority to lowest priority. User important style sheets
Author important style sheets Author normal style sheets User normal style sheets
User agent style sheets
* CSS declarations are applied in this order (from lowest to highest priority):
· User agent declarations (the default styles your browser applies to elements)
· User normal declarations (a user's own stylesheet if they're using one)
· Author normal declarations (this is your normal stylesheet)
· Author important declarations (anything your mark important)
· User important declarations (any important styles from the user's stylesheet)
Reference: Assigning property values, Cascading, and Inheritance; In what order do CSS definitions take priority
http://www.w3.org/TR/CSS21/cascade.html
http://www.quora.com/In-what-order-do-CSS-definitions-take-priority
NEW QUESTION 22
You are developing a web page that includes the following HTML.
<span id = "myTextSpan" class = "redText"> Hello There! </span> The font color of text inside the span must be red.
You need to develop the web page to meet the requirement.
Which two CSS segments will achieve the goal? (Each correct answer presents a complete solution. Choose two.)
- A. Option A
- B. Option B
- C. Option C
- D. Option D
Answer: AC
Explanation:
You can refer to class, by .redText, or the span, by span#myTextSpan.
NEW QUESTION 23
HOTSPOT
You are creating a function by using JavaScript. The function accepts an object as the parameter and returns a string that identifies the data type of the object.
You have the following requirements:
The function must return "Number" if the object is a number. The function must return "String" if the object is a string.
The function must return "Unknown" if the object is neither a number nor a string. You need to implement the function to meet the requirements.
How should you build the code segment? (To answer, select the appropriate options from the drop- down lists in the answer area.)
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
* Use the switch statement to select one of many blocks of code to be executed.
Syntax switch(expression) {
case n:
code block break;
case n:
code block break;
default:
default code block
}
This is how it works:
The switch expression is evaluated once.
The value of the expression is compared with the values of each case. If there is a match, the associated block of code is executed.
* Object.prototype.constructor
Returns a reference to the Object function that created the instance's prototype. Note that the value of this property is a reference to the function itself, not a string containing the function's name. The value is only read-only for primitive values such as 1, true and "test".
* Description
All objects inherit a constructor property from their prototype: var o = {};
o.constructor === Object; // true var a = [];
a.constructor === Array; // true var n = new Number(3); n.constructor === Number; // true
* The constructor property is created together with the function as a single property of func.prototype.
Reference: JavaScript Switch Statement;Object.prototype.constructor
NEW QUESTION 24
You develop an HTML5 application for a company. Employees must enter a personal identification number (PIN) in an INPUT element named SecurityCode to access their employee records.
The SecurityCode element must meet the following requirements: Allow up to 6 digits.
Do not display numbers as they are entered.
Display the text Enter PIN Code before the user enters any data. You need to implement the SecurityCode element.
Which HTML markup should you add to the application?
- A. Option A
- B. Option B
- C. Option C
- D. Option E
Answer: D
Explanation:
* Input Type: password
<input type="password"> defines a password field.
The characters in a password field are masked (shown as asterisks or circles).
* The placeholder attribute specifies a short hint that describes the expected value of an input field
a. g. a sample value or a short description of the expected format).
The short hint is displayed in the input field before the user enters a value.
The placeholder attribute works with the following input types: text, search, url, tel, email, and password.
Reference: HTML Input Types ; HTML <input> placeholder Attribute
NEW QUESTION 25
You develop an interactive scalable vector graphic (SVG) application.
You write the following code (Line numbers are included for reference only.):
You need to increase the size of the circle by 50 percent. Which code segment should you insert at line 02?
- A. Option A
- B. Option B
- C. Option C
- D. Option D
Answer: D
Explanation:
Increase the radius (the r property) of the circle (not the graphic) by a factor 1.5. Incorrect:
CurrentScale is used for zooming. Reference: The HTML <svg> Element
NEW QUESTION 26
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
Explanation:
* type:
We post a SOAP request.
* data:
Data to be sent to the server.
The data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}.
Reference: jQuery.ajax()
NEW QUESTION 27
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?
- A. tr:not(tr:last-child).selected < #dataTable
- B. #dataTable > tr.selected:not(tr:last-child)
- C. #dataTable tbody tr.selected:not(tr:last-child)
- D. #dataTable tr.selected:not(tr:last-child)
Answer: C
Explanation:
* [attribute] [target]
Selects all elements with a target attribute
* :not(selector) not(p)
Selects every element that is not a <p> element Reference: CSS Selector Reference
NEW QUESTION 28
You are developing an HTML5 web application and are styling text. You need to use the text-transform CSS property.
Which values are valid for the text-transform property?
- A. hidden
- B. blink
- C. capitalize
- D. line-through
Answer: C
Explanation:
CSS Syntax
text-transform: none|capitalize|uppercase|lowercase|initial|inherit; Example
Transform text in different elements: h1 {text-transform:uppercase;}
h2 {text-transform:capitalize;} p {text-transform:lowercase;}
Reference: CSS text-transform Property http://www.w3schools.com/cssref/pr_text_text-transform.asp
NEW QUESTION 29
DRAG DROP
You are creating an application by using HTML5 and CSS3. The styles for the pages are derived from five style sheets.
The styles are not being applied correctly to the pages in the application.
You need to determine the order in which the style sheets will be applied by the browser.
In which order will the five style sheets be applied? (To answer, move the style sheet types from the list of style sheet types to the answer area and arrange them in the order that they will be applied.)
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
Box 1: user agent style sheets Box 2: user normal style sheets
Box 3 author normal style sheets: Box 4: author important style sheets Box 5: user important style sheets Note:
The order of declarations from least important to most important:
user agent declarations user normal declarations author normal declarations
author important declarations user important declarations
NEW QUESTION 30
DRAG DROP
You have a page that uses HTML5 and CSS3. The page contains the following markup.
What are the font color and the background color of the links when the page renders? To answer, drag the appropriate colors to the correct locations. Each color 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.
NOTE: Each correct selection is worth one point.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation: Link font color: Explanation:
Yellow
Link background color: Fuchsia References:
NEW QUESTION 31
......
Recommend!! Get the Full 70-480 dumps in VCE and PDF From Certstest, Welcome to Download: https://www.certstest.com/dumps/70-480/ (New 322 Q&As Version)