How to have div elements perform keystrokes on their behalf in jQuery

Asked 1 years ago, Updated 1 years ago, 62 views

Is there any way to keep pressing the down arrow key while clicking the div element "down" below?

As far as I'm concerned, I think I can use onmusedown to make the decision, but I don't know how to have javascript enter the keystroke instead

<div class="down">
    <h1>↓</h1>
</div>

Thank you for your cooperation.

javascript html jquery html5

2022-09-30 19:31

1 Answers

MDN Web Docs on Mozilla.org provides a description.

https://developer.mozilla.org/ja/docs/Web/API/KeyboardEvent#auto-repeat_handling

However, if you keep pressing the key, the way you treat it depends on the browser.
There are probably not many people who try it, so old articles stand out.I think it's better to verify what's going on with the latest version.

http://shain.blog.conextivo.com/2007/03/javascript.html


2022-09-30 19:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.