0

I'm trying to select text with a mouse in Textarea and click the button and delete the selected text.

I'm using:

window.getSelection().empty()

and it just doesn't work.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • Not enough information, show the relevant code, a [mcve]. – Teemu Oct 12 '18 at 07:55
  • 1
    Possible duplicate of [How to remove selected text from an input Text?](https://stackoverflow.com/questions/36859165/how-to-remove-selected-text-from-an-input-text) – VLAZ Oct 12 '18 at 07:57
  • please ask specific question. The question needs improvement in several areas. 1> The question should have an introduction to where and how you faced it, 2> what did you try to resolve that, 3> why and what assistance you need from the commnity when you failed to resolve that – Md. Tazbir Ur Rahman Bhuiyan Oct 12 '18 at 08:13
  • @Ibrahimshaikh how is it not the same functionality? The accepted answer in the dupe shows how you can select text, click a button and delete the selection. This matches with `click the button and delete the selected text` – VLAZ Oct 12 '18 at 08:14
  • @vlaz here he don't have any button mentioned, he wants to delete by mouse click, look at the answer from that question and mine both the answers are different from each other –  Oct 12 '18 at 08:16

0 Answers0