PrepAway - Latest Free Exam Questions & Answers

You develop an HTML5 webpage that contains the following HTML markup:

You develop an HTML5 webpage that contains the following HTML markup:



You have the following requirements:

Retrieve the content for any OPTION elements when the value of the selected attribute equals selected.

Add the content to a comma separated string.

You need to retrieve the required data.

Which two code segments should you add to the webpage? (Each correct answer presents a complete solution. Choose two.)



A. Option A

B. Option B

C. Option C

D. Option D

E. Option E

Explanation:

Note:

* select option:selected

:selected Selector

Description: Selects all elements that are selected.

2 Comments on “You develop an HTML5 webpage that contains the following HTML markup:

    1. _mr says:

      I agree. I just wanted to add that the only reason why C & D are correct is $(this) selector which points to selected options in .each() function and not to parent select element.

      It means that:
      * :checked is totally fine and would work exactly the same as :selected;
      * $(loanTypes) selector points to wrong element but semantically is correct for IDs, which means that it is not an error that “”/” are missing here;




      2



      0

Leave a Reply