Vue JS Get Dropdown Selected Value Example

Vue JS Get Dropdown Selected Value Example

In this post we will give you information about Vue JS Get Dropdown Selected Value Example. Hear we will give you detail about Vue JS Get Dropdown Selected Value ExampleAnd how to use it also give you demo for it if it is necessary.

In this post, i will let you know how to get selected option value of dropdown in vue js. you can get select box selected value using vuejs onchange event. bellow example you will understand how to get dropdown selected value in vue js.

We can get selected value of select box using onchange event in vue.js. we will create one vue js function that will call with on change of select box option. you can see bellow full example, that will help you to understand how works onchange event to get value of selected option.

You can see bellow full example:

Example:

<!DOCTYPE html>

<html>

<head>

<title>Vue JS Get Dropdown Selected Value Example - ItSolutionStuff.com</title>

<script src="https://cdn.jsdelivr.net/npm/vue"></script>

</head>

<body>

<div id="app">

<select name="category_id" @change="onChange($event)" >

<option>--- Select Category ---</option>

<option value="1">PHP</option>

<option value="2">Laravel</option>

<option value="3">Codeigniter</option>

<option value="4">Vue JS</option>

<option value="5">Angular JS</option>

</select>

</div>

<script type="text/javascript">

var app = new Vue({

el: '#app',

methods: {

onChange(event) {

console.log(event.target.value);

}

}

})

</script>

</body>

</html>

Output:

Also see:How to get string length in Vue JS?

2

3

I hope it can help you…

Hope this code and post will helped you for implement Vue JS Get Dropdown Selected Value Example. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

  +  66  =  76

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US