【发布时间】:2013-04-08 20:10:07
【问题描述】:
如果我从文本区域中选择文本,我需要知道选择了哪个文本,例如“hello world”如果我选择 hello,我想看到 hello 被选中我如何在 jquery 中执行此操作。我想让它加粗。
<textarea id="editor" cols="80" rows="20">
Hello world, This is Me!
</textarea>
<button onclick="SelectText()">
Bold
</button>
【问题讨论】:
-
发现这个也许会有所帮助 [stackoverflow.com/questions/7186586/…
-
许多帖子的重复。
-
i want to make it bold。您不能在 textarea 内容中应用样式。
标签: javascript jquery