Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道一种简单的方法,可以在我在输入表单/文本框中书写时立即突出显示一组单词。
突出显示将光标移动到文本框的开头(至少在 IE 中),并且键入会将突出显示的文本替换为新键入的文本。即使您知道如何将光标一直移动到用户想要输入的位置,我想当文本突出显示和未突出显示时会有很多烦人的闪烁。你想达到什么目的?你能onblur="this.select()"代替吗?
onblur="this.select()"