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?

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

Explanation:
The string pattern “*name” matches all strings that ends with name.



Leave a Reply 9

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

ten − 3 =


safaa

safaa

D. $( ‘input [name=”$name”] ‘) .css ({ ‘background-color’ : ‘#E0ECF8’});

Ahmed Graihy

Ahmed Graihy

correct answer is D

puvpul

puvpul

It is D. It is D

fbasa

fbasa

$(‘input[name$=”name”]’).css(‘background-color’, ‘#E0ECF8’);

dvixextract

dvixextract

the answer is D

abc

abc

explain how it is d?

asdf

asdf

the $ is like in regex “Ends with”
the only wrong Thing is that it should be before = like fbasa said