473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Copy text from HTML page

OK, I've got a requirment to copy some content from an HTML page. It is
a failry lengthy page and we want to give the user/reader the ability to
click a button and have a section of the page copied to the clipboard,
or at the very least selected so they can just right click and copy it.
The issue is that text/content to be selected/copied is not in a textarea.

I've got it in a div right now and can get the innerHTML of the div and
set a text area to that but it comes in with all of the HTML tags and so
when I copy it to notepad I get all of the tags which is what I dont want.

Has anyone done this before? I've tried numerous things to get it to
work and have had no luck.

Thanks in advance.

Dave
Jul 23 '05 #1
5 1808
VK
did you try innerText instead of innerHTML?
Jul 23 '05 #2
VK wrote:
did you try innerText instead of innerHTML?

The innerTest of a div (and a span) is undefined. :(
Jul 23 '05 #3
On Fri, 01 Oct 2004 11:05:08 -0400, Dave Vick wrote:
VK wrote:
did you try innerText instead of innerHTML?

The innerTest of a div (and a span) is undefined. :(


...what about the innerTe*x*t?

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #4
Andrew Thompson wrote:
On Fri, 01 Oct 2004 11:05:08 -0400, Dave Vick wrote:

VK wrote:
did you try innerText instead of innerHTML?


The innerTest of a div (and a span) is undefined. :(

..what about the innerTe*x*t?

:) Yes the innerText is undefined too :)
Jul 23 '05 #5
Dave Vick wrote:
OK, I've got a requirment to copy some content from an HTML page. It is
a failry lengthy page and we want to give the user/reader the ability to
click a button and have a section of the page copied to the clipboard,
or at the very least selected so they can just right click and copy it.
The issue is that text/content to be selected/copied is not in a textarea.

I've got it in a div right now and can get the innerHTML of the div and
set a text area to that but it comes in with all of the HTML tags and so
when I copy it to notepad I get all of the tags which is what I dont want.

Has anyone done this before? I've tried numerous things to get it to
work and have had no luck.


Create a range, select it, copy it. Google the newsgroup archives. And
yes, I have done it before.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tabonni | last post by:
Hi all I want to create an ASP page, which can copy the real PDF files into the clipboard and then the user can paste it in Outlook message as attachments(it's like inserting attachments) My...
3
by: cv | last post by:
Hi all, I have to copy two set of data from 2 files(notepad/excel) say, products and their corresponding prices to list/textarea/table. I should be able to retrieve the product and corresponding...
0
by: Tess | last post by:
Hi, Long time reader, first time poster... Any help is appreciated. I have a few questions regarding Winform controls embedded within an html page. For more info please see the appendix. Now,...
2
by: David | last post by:
Hi, I hope this is the correct place for this post. I have also posted to the JavaScript group. I have an asp page with a form. The form has 2 text boxes for entering a serial number range....
4
by: Risto Heinonen | last post by:
Hi. I have a web page that has images and text. I can carefully select one image and the on the right of the image and then copy & paste to Word. Is it possible to make javascript do the same:...
1
by: Wladimir Borsov | last post by:
I want to mark certain text on a web page in InternetExplorer and then copy and paste it into a normal text editor. With the copied text not only the pure text should be transferred but also the...
2
by: Clodoaldo Pinto Neto | last post by:
Hi all, I'm trying to copy a table with a text field column containing a new line char to a file: ksDesenv=# create table page(line text) without oids; CREATE TABLE ksDesenv=# insert into...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
10
by: Sillu | last post by:
I'ld like to create a web page, from which no one can select the text simply, copy frm there n paste at another location. In simple means, i'ld like to stop copy process from my web page. Plz...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.