I have several select options inputs on a form. I want to 'unselect' all selected option on the click of a button.
jquery has a method for this.
$("option:selected").removeAttr("selected");
is there a similar way to do this in vue.
these are my select options:
<template>
<form id="myform">
<select @change="clearOptions($event)" id="mySelect">
<option>Pineapple</option>
<option>Banana</option>
</select>
<select @change="clearOptions($event)" id="mySelectTwo">
<option>Apple</option>
<option>Orange</option>
</select>
</template>
<script setup>
const clearOptions = (e) => {
e.preventDefault()
$("option:selected").removeAttr("selected");
}
</script>