Which code segment should you use?

A Web page includes the HTML shown in the following code segment.

<span id=”ref”>
<a name=Reference>Check out</a> the FAQ on <a href=”http://www.contoso.com”>Contoso</a>’s web site for more information: <a href=”http://www.contoso.com/faq”>FAQ</a>.
</span>
<a href=”http://www.contoso.com/home”>Home</a>

You need to write a JavaScript function that will dynamically format in boldface all of the hyperlinks in the ref span.
Which code segment should you use?

A Web page includes the HTML shown in the following code segment.

<span id=”ref”>
<a name=Reference>Check out</a> the FAQ on <a href=”http://www.contoso.com”>Contoso</a>’s web site for more information: <a href=”http://www.contoso.com/faq”>FAQ</a>.
</span>
<a href=”http://www.contoso.com/home”>Home</a>

You need to write a JavaScript function that will dynamically format in boldface all of the hyperlinks in the ref span.
Which code segment should you use?

A.
$(“#ref”).filter(“a[href]”).bold();

B.
$(“ref”).filter(“a”).css(“bold”);

C.
$(“a”).css({fontWeight:”bold”});

D.
$(“#ref a[href]”).css({fontWeight:”bold”});



Leave a Reply 1

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