Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue select option get attribute

var app = new Vue({
  el: '#app',
  methods: {
    onChange: function() {
      var options = event.target.options
      if (options.selectedIndex > -1) {
        var name = options[options.selectedIndex].getAttribute('name');
        console.log(name)
      }
    }
  },
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vue #select #option #attribute
ADD COMMENT
Topic
Name
8+8 =