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?
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8"/>
<script src="./jquery-3.4.1.js"></script>
<script>
window.onload = function(){
// *= Specifies that the attribute has a value CONTAINING the specified text.
$('input[name*="name"]').css('background-color', '#E0ECF8');
// $= Specifies that the attribute has a value ENDING with the specified text.
$('input[name$="name"]').css('background-color', '#EFECF8');
}
</script>
</head>
<body>
<label for="personname">Given and Surname:</label>
<input type="text" name="personname"/><br/>
<label for="businessname">Business Name:</label>
<input type="text" name="businessname"/><br/>
<label for="emailaddress">Email Address:</label>
<input type="text" name="emailaddress"/>
</body>
</html>
C. ${'input[name="*name"]').css({'background=color': #E0ECF8'});
change 'background=color' to 'background-color'
upvoted 3 times
...
This section is not available anymore. Please use the main Exam Page.70-480 Exam Questions
Log in to ExamTopics
Sign in:
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.
Shapespacer
Highly Voted 5 years, 4 months agoSanfour
Highly Voted 4 years, 11 months agoPHULU
Most Recent 4 years, 7 months agoKyryIx
5 years, 2 months agomart123
5 years agonelaed
4 years, 9 months agoSGT
5 years, 8 months ago