Html:
<select v-model="facilitySelected" name="facilities" multiple="multiple" id="facilities" size="4" class="form-control">
<option value="1">Double (Non a/c)</option>
<option value="2">Premium Double (a/c)</option>
<option value="3">Standard Double (a/c)</option>
</select>
Click event:
<a @click="addFacilities" class="btn btn-default add_option" rel="facilities2" id="add"><i class="fa fa-arrow-right"></i></a>
Script:
export default {
data(){
return{
facilitySelected:[]
}
}
methods: {
addFacilities() {
this.facilitySelected;
console.log(this.facilitySelected);
}
}
}
Here i have a list of select with options,
When i click on the addFacilities, the value of the selected option only making as output in console.log, i need to have both value as well as the text in the option to be come out through console.log.. How to get both the value and the text when i click on the addFacilities?