Answer the question
In order to leave comments, you need to log in
How to make vue analog onClick="foo(this)" work?
In js, you can hang an event on an element and send a pointer to the element to a function:
<div onClick="foo(this)">
function foo(el){
alert(el);
}
<div @click="foo(this)">
foo(el){
alert(el);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question