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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
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
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

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: 61413
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Copy text from DIV