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.)
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.)
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
That is what is indicated. I believe you are confusing the choices that remain with the answer.
You are correct
Answer is correct
Answer is correct indeed