开发者

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

开发者 https://www.devze.com 2023-03-08 03:22 出处:网络
This question already has answers here: 开发者_JAVA技巧 How to use square cursor in a HTML input field?
This question already has answers here: 开发者_JAVA技巧 How to use square cursor in a HTML input field? (6 answers) Closed 6 years ago.

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消