如果我从文本区域中选择了一段文本,我需要知道哪些文本被选中,例如“hello world”,如果我选择了“hello”,我想看到“hello”被选中了,我该如何在jQuery中实现这一点,并使其加粗。
<textarea id="editor" cols="80" rows="20">
Hello world, This is Me!
</textarea>
<button onclick="SelectText()">
Bold
</button>