rctneil
rctneil

Reputation: 7220

Get selectedOptions on sl-select with Shoelace.style

I have an <sl-select> element from Shoelace.style.

I have selected it in my script but unlike the native <select>, it doesn't appear to have a selectedOptions property.

Is there an alternative? or how can I get selectedOptions from it?

What options do I have here?

Upvotes: 0

Views: 970

Answers (1)

Nick C
Nick C

Reputation: 33

You can achieve the same thing by checking the value attribute on the sl-select component.

Here is a demo of it working.

Upvotes: 1

Related Questions