Vue JS Get Data Attribute Value Example




Hi Guys,

Today, I will learn you how to get data attribute value in vue js. we will show example of vue js get data attribute value. i can help you to get data attribute value in vuejs. we will write a button click event and get custom attribute value in vue.js.

In this example, we will take on the button with a custom attribute like "data-id" and on click event of the button, we will get that value of the custom data attribute value in the console. we will get data attribute value using

You can see bellow syntax:;


<!DOCTYPE html>



<title>How to get data attribute value in Vue JS? -</title>

<script src=""></script>



<div id="app">

<button v-on:click="callFunction" data-id="15">Click Me</button>



<script type="text/javascript">

new Vue({

el: '#app',

data: {

message:"Welcome, Please Wait...."



callFunction: function (event) {

var id ='data-id');







It will help you...