I want to bind the text of select option to the text of a span. I want to display the text of select box, not the value.
<div class="w-full flex" x-data="{category:0}">
<div class="relative w-auto" >
<span x-text="category"></span>
</div>
<select id="category" class="cursor-pointer" x-ref="category" x-model="category">
<option value=0 selected="selected">One</option>
<option value=1>Two</option>
<option value=2>Three</option>
</select>
</div>
Now, when I select option, the span displays - 0, 1, 2.
I want to display "one", "two", "three" instead which are the text of select option.
How can I do this?