Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2002
    Location
    Virginia, USA
    Posts
    621
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Selecting Div content

    Howdy folks. I don't have time to write this on my own...

    I need (cross-browser) a method (via clicking a link) that will copy all contents of a div to the clipboard.


    I tired doing a mydiv.focus;mydiv.selected() but it didn't want to work...silly nested divs....

    anyhew, appreciate it.

    TIA
    -Celt

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    will copy all contents of a div to the clipboard
    hm... As far as I know, you can not copy anything in the clipboard using whichever internet's application... Are you sure you want to copy by all means in the OS's clipboard? What is your task, anyway?

    You can reference and use a DIV's content using

    document.getElementById('mydiv').innerHTML

    method
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is the (cross-browser) requirement which the O/P will have trouble with. Several IE copy to/from the clipboard solutions have recently been posted. Try using the Search feaature to look for those posts.

    .....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •