Can I change the blinking caret in a form/text area in a browser? [duplicate]

时光毁灭记忆、已成空白 提交于 2019-11-28 03:49:11

问题


I want to have a custom text caret in my text field for my web page. I would like to have an old school block type blinking caret. Is this possible?


回答1:


The simple answer is you can't (change the user's blinking caret) via javascript, html, or css as that is created and managed by the chrome (the browser beyond the DOM)

Wanna fake it? http://www.dynamicdrive.com/forums/showthread.php?t=17450

The code examples shown are pretty old, but the idea remains the same-- Make a blinking box and have it tail the input...

With thats all said, I highly suggest against using it in anything but the smallest, niche, 'for fun' way as having a javascript function fire and be altering the DOM on every keyDown is bordering on user abuse imho.



来源:https://stackoverflow.com/questions/6092963/can-i-change-the-blinking-caret-in-a-form-text-area-in-a-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!