get selected text in the textarea

how can i get the selected text in the textarea in the Html?

Comments

  • Pass the id of the element to the function, or reference to it
    [code]
    function copyToClipboard(id){
    // Copy displayed code to user's clipboard.
    var textRange = document.body.createTextRange();
    textRange.moveToElementText(id);
    textRange.execCommand("Copy");
    }
    [/code]
    This will work for IE though, have no idea what to do in Netscape

    [b][italic]Philip Patrick[/italic][/b]
    [b]Home page[/b]: http://www.saintopatrick.com
    [size=1][italic]"Two beer or not two beer?"[/italic] [b]Shakesbeer[/b][/size]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion