Is it possible to apply CSS rules to a specific string of letters inside an input box. For example, if the string is ing
and the user inputted playing
, just the letters "ing" would show up as a different color.
It is my understanding that inputs cannot contain HTML, so one workaround would be to hide the input and turn its value into HTML so that I could surround the matching text with a <span>
. However, this gets rid of the cursor and text highlighting, so this solution does not work for me. I am using React.
Thank you!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…