exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 4 question 40 discussion

Actual exam question from Microsoft's 70-480
Question #: 40
Topic #: 4
[All 70-480 Questions]

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. $ ('input [name!="name"]’) .css ({ 'background-color' : ' #E0ECF8'}) ;
  • B. ${'input [name="~name"] ') .css ({ 'background-color' : ' #E0ECF8' }) ;
  • C. ${'input[name="*name"]').css({'background=color': #E0ECF8'});
  • D. $( 'input [name="$name"] ') .css ({ 'background-color' : '#E0ECF8'});
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
The string pattern "*name" matches all strings that ends with name.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MrEngineer
Highly Voted 5 years, 6 months ago
Answer should be D
upvoted 14 times
rshirts
5 years, 6 months ago
https://www.w3schools.com/jquery/sel_attribute_end_value.asp
upvoted 2 times
...
Raly
4 years, 8 months ago
* = if it contains the text $ = if it ends in the text
upvoted 2 times
...
...
soni
Highly Voted 5 years, 5 months ago
There is no correct answer. The answer will be like $('input[name$="name"]').css("background-color", "green");
upvoted 11 times
...
jaimeyzv
Most Recent 5 years, 1 month ago
The three last options have typos so let's consider they dont have it. The proper answer will be D. $( 'input [name="$name"] ') .css ({ 'background-color' : '#E0ECF8'});
upvoted 3 times
...
piroman
5 years, 6 months ago
There is no correct answer
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...