开发者

How can I highlight spaces with jquery?

I have an input textfield that has segmented chinese words(usually they are all squashed together).

I want to highlight the space between the words, on the fly(So in other word开发者_如何学编程s if i type a space between 你好 the space between the characters would be red) When I submit the text however I want to only submit the chinese with the spacing, no html or highlighting. Is this possible?


I don't think you can apply "styling" on the text box itself. You can probably use a "preview" div (just like stackoverflow) and highlight the spaces there, using simple css.


As @egarcia said, you can't highlight spaces in textfiled, you might want to use a rich text editor. To highlight, you might be interested in:

  • jQuery Highlight Plugin
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜