PrepAway - Latest Free Exam Questions & Answers

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.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

6 Comments on “Which jQuery code segment or segments should you use?

  1. Fritsche says:

    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




    1



    0

Leave a Reply