'Alpine js get original element in bind method
Assuming I want to get the original element within the Alpine.bind method, how would I do that?
So I can retrieve properties like $el.targetName,$el.style, $el.onclick etc
For example, if I have :
<script>
document.addEventListener('alpine:init', () => {
Alpine.bind('SomeButton', () => ({
type: 'button',
'@click'() {
// How would i get the target element with ll its DOM properties
//So I can retrive properties like $el.targetName,$el.style, $el.onclick etc
},
}))
})
</script>
I've tried $el, this(which only returns a js proxy) etc
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
