Event keyup for an element

I’d like to add event keyup for an element like a div like this:

<div class="my-div" data-action="keyup->myController#myfunction"></div>

But it’s impossible. I don’t want to use $(document).bind(‘keyup’, function(e){ … }).
How to do ? Thanks

1 Like

I found:

<div class="my-div" data-action="keyup->myController#myfunction" tabindex="0"></div>

It’s work !

2 Likes