Which jQuery code segment or segments should you use?

DRAG DROP
You are developing a website that has many web pages with hyperlinks to other sites.
You need to ensure that if a hyperlink contains an image, the linked web page opens in a new
window.
Which jQuery code segment or segments should you use? (To answer, drag the appropriate line of
code to the correct location. Each line of code may be used once, more than once, or not at all. You
may need to drag the split bar between panes or scroll to view content.)

DRAG DROP
You are developing a website that has many web pages with hyperlinks to other sites.
You need to ensure that if a hyperlink contains an image, the linked web page opens in a new
window.
Which jQuery code segment or segments should you use? (To answer, drag the appropriate line of
code to the correct location. Each line of code may be used once, more than once, or not at all. You
may need to drag the split bar between panes or scroll to view content.)

Answer:



Leave a Reply 5

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


Fritsche

Fritsche

I think the answer is wrong. With the selector $(‘a’) every Hyperlink become the target Attribute. But the requirement is:

You need to ensure that if a hyperlink CONTAINS an image, the linked web page opens in a new window.

So the selector must be: $(‘a img’) and then in the seccond $(this).parent

Al

Al

That is what is indicated. I believe you are confusing the choices that remain with the answer.

Fritsche

Fritsche

You are correct

J

J

Answer is correct

Levi

Levi

Answer is correct indeed