957 0 0 0
Last Updated : 2024-04-26 22:46:59
How do you select a particular option in a SELECT element in jQuery?
A selector to get the middle option-element by value is
$('.selDiv option[value="SEL1"]')
For an index:
$('.selDiv option:eq(1)')
For a known text:
$('.selDiv option:contains("Selection 1")')
Then add selected
$('.selDiv option:eq(1)').prop('selected', true)