简体   繁体   中英

HTML input box, how to prevent key repeat when key is held down

Is there a way to prevent auto-repeat behavior in an HTML input ( type="text" )?

So that when you hold down the a key while in the input box, only one character is used, instead of repeating the character until the user releases the key.

I know how to do this for key-events in the browser but HTML input type="text" boxes seems to be in a world of their own.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM