aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Copy text from DIV Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Copy text from DIV" Watch "Copy text from DIV" New topic
Author

Copy text from DIV

kwon yuu
Greenhorn

Joined: Jul 20, 2010
Posts: 8
Hi all,

My interface is written using div.
I would like to copy some text from the interface when the application is run.
But I could not able to do this because of div.
Is there a way to copy certain text from div?
Hope someone can give me a guideline.
Thanks.
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9191
    
    2

I'm not really sure what you are trying to say here. You can easily get the contents of a div (or any other HTML element) by assigning an id to the HTML element and then using getElementById('myId').innerHTML


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
kwon yuu
Greenhorn

Joined: Jul 20, 2010
Posts: 8
Thanks.
What I meant is I can't select or copy/paste the text that I wrote within div.
I don't want to get all div elements. I don't understand why I can select or do copy/paste after I do my layout with div.
Any idea?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56554
    
  14

The use of <div> elements does not prevent copying to the clipboard.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Copy text from DIV
 
Similar Threads
does <div> have any onBlur method ?
Multiple jQuery accordions?
help with this type of programa (manipulating text)
Forwarding the current page to previous page
set text into text field