I would like to have attribute tblid from button element, when click event is triggered.
I was reading questions like this, but it's not working for me -> example below.
What seems so strange to me is that e.target or e.currentTarget returns the element with all attributes, including tblid. Why is so hard in vuejs to get those attributes from element?
Please note: I know I can create component and use props on that component. But I really don't want to create component for every html element like button, label, input ...
html:
<div id="app">
<button tblid="tbl1" @click="buttonClick($event)">
Button 1 tbl1
</button>
</div>
app.js:
new Vue({
el: "#app",
methods: {
buttonClick(e){
debugger;
}
}
});
