在TextArea中的当前光标位置插入文本 [英] Insert text at current cursor position in TextArea

查看:78
本文介绍了在TextArea中的当前光标位置插入文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在JavaScript中的当前光标位置将文本插入textarea?

How do I insert text into a textarea at the current cursor position in JavaScript?

推荐答案

我认为你不能这样做。我不知道任何会在文本字段中提供光标/胡萝卜位置的事件。有一种方法可以获取所选文本,然后替换,修改,删除该文本。
I do not think you can do that. I do not know of any events that will give you the position of the cursor/carrot in a text field. There is a way to get selected text, and then replace, modify, remove that text.


javascript无法做到吗?


ha,这是一个新的...

FF的b $ b:

javascript cannot do it?

ha, that''s a new one...

for FF:

展开 | 选择 | Wrap | 行号



javascript无法做到吗?


ha,这是一个新的...

FF的b $ b:

javascript cannot do it?

ha, that''s a new one...

for FF:

展开 | 选择 | Wrap | 行号


这篇关于在TextArea中的当前光标位置插入文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆