Question:Which of the following is the correct way to get "Option B" with the value '2' from following HTML code in jQuery?
<select id='list'>
    <option value='1'>Option A</option>
    <option value='2'>Option B</option>
    <option value='3'>Option C</option>
</select>
 

A $("#list[value='2']").text(); 

B $("#list option[value='2']").text(); 

C $(this).find("option:selected").text(); 

D element.options[element.selectedIndex].text 

+ Answer
+ Report
Total Preview: 933

Copyright © 2024. Powered by Intellect Software Ltd