get selected text in the textarea

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


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

    [b][italic]Philip Patrick[/italic][/b]
    [b]Home page[/b]:
    [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!


In this Discussion