开发者

Is there a javascript library can help me to operate textarea? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

how can i get cursor position in a textarea?

I want some basic but common operations on textarea with javascript, such as

  • get the cursor position
  • set the cursor position
  • insert some tex开发者_StackOverflow中文版t to the cursor position
  • select all text in textarea
  • select a range of text
  • insert some text to the cursor position, and select it immediately.

I hope it working cross-browers.

Is there such javascript library?


There's a jQuery plug-in I've written that does all of this. There's a standalone version too but it needs a little bit of tidying. If you'd prefer no jQuery then it would give me a reason to sort it out and release it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜