【发布时间】:2014-04-30 18:37:06
【问题描述】:
我有一个带有文本区域 (id = details) 的表单。
有没有一种方法可以在此文本区域中按 Enter 键时在光标位置插入换行符 (<br />) 的 HTML 代码?
我只需要这个就可以在 IE 中工作。
<textarea class="input height120 elastic span12" name="details" id="details" onkeyup="countCharLimit(event)" onpaste="countCharLimit(event)"></textarea>
【问题讨论】:
-
你为什么需要它?输入已经为你做到了:)
-
上面开个玩笑,看看我的回答
标签: javascript jquery html textarea cursor-position