I want to get a select option name attribute in vuejs. I tried it to value attributes. It worked well. I have mentioned the tried code below.
Tried code:
<select id="countryselect" name="country" @change="onChange()">
<option value="1" name="0">Afghanistan</option>
<option value="2" name="0">Albania</option>
<option value="3" name="0">Algeria</option>
<option value="4" name="1">Malaysia</option>
<option value="5" name="0">Maldives</option>
</select>
var app = new Vue({
el: '#app',
methods: {
onChange: function() {
//this workes well
var b = event.target.value;
// this not workes
var c = event.target.name;
}
},
});
I want to know how can I do this. Thank you.