Changing the highlight color when selecting text in an HTML text input

后端 未结 10 1086
有刺的猬
有刺的猬 2020-11-30 00:07

I\'ve been looking for this throughout the web and can\'t even find anyone else even asking this, let alone a solution...

Is there a way to change the color of the h

10条回答
  •  迷失自我
    2020-11-30 00:54

    Thanks for the links, but it does seem as if the actual text highlighting just isn't exposed.

    As far as the actual issue at hand, I ended up opting for a different approach by eliminating the need for a text input altogether and using innerHTML with some JavaScript. Not only does it get around the text highlighting, it actually looks much cleaner.

    This granular of a tweak to an HTML form control is just another good argument for eliminating form controls altogether. Haha!

提交回复
热议问题