:selected
selectorThe jQuery :selected
selector is used to select <option>
elements that are selected.
:selected
selector Syntax$(':selected')
:selected
selector ExamplesIn below example,Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then triggers the event for the initial text draw.