Internet Explorer で次のコードを使用して、選択したテキストを取得できます。
var selectedText;
// IE version
if (document.selection != undefined)
{
textComponent.focus();
var sel = document.selection.createRange();
selectedText = sel.text;
}
しかし、たとえば、Google Chrome と Internet Explorer の両方で JavaScript を使用して、TEXTAREA で選択したテキストを削除する方法は?