Which code segment should you add to the webpage?

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’});

microsoft-exams

2 thoughts on “Which code segment should you add to the webpage?

  1. The correct answer should be D with a small change: $( ‘input [name$=”name”] ‘) .css ({ ‘background-color’ : ‘#E0ECF8’});

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.