473,320 Members | 2,006 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,320 software developers and data experts.

Grabbing selected text in a named <SPAN> ?

Dear Friends

IE5+, Win9*, not Netscape - I understand getSelection() is Netscape
only.

Anyone know of a way to access an area of mouse selected text within a
<SPAN> or <DIV> ( ie not in a form/input/text area tag) and assign it to
a variable ?

I can't seem to find a way in my reference book, or online, or by trial
and tedious errors.

Many thanks for any suggestions.
--
Mervyn Carter
================================================== ===
For every complex problem there is a solution which is straightforward,
simple, and wrong ! H. L. *Mencken
================================================== ===
Jul 23 '05 #1
2 1712
I think this can be done by creating a TextRange object (IE only) and
reading its Text property. Take a look at MSDN's DHTML Reference.
It's essential reading IMO for client-side web development.

http://msdn.microsoft.com/library/de..._textrange.asp

Jul 23 '05 #2
Mervyn Carter wrote:
Dear Friends

IE5+, Win9*, not Netscape - I understand getSelection() is Netscape
only.

Anyone know of a way to access an area of mouse selected text within a <SPAN> or <DIV> ( ie not in a form/input/text area tag) and assign it to a variable ?

I can't seem to find a way in my reference book, or online, or by trial and tedious errors.

Many thanks for any suggestions.
--
Mervyn Carter
================================================== ===
For every complex problem there is a solution which is straightforward, simple, and wrong ! H. L. Mencken ================================================== ===

Henry Mencken lives !

http://www.massless.org/mozedit/

Jul 23 '05 #3

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

Similar topics

3
by: Alexander Ross | last post by:
I have an html snippet, and I want to remove any <span> tags that have a specific attribute (class=none) ex. The quick brown <span class="animal">fox</span> jumped <span...
13
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
4
by: DMJ | last post by:
What is the difference between these two tags?
3
by: Andrew Tang | last post by:
Hi. I'm having problems with the following code. The last line seems to be in the wrong place, its been moved down slightly by about 3 pixels in IE6. <html> <head> <title>Lorem Ipsum</title>...
18
by: Timothy Casey | last post by:
Thanks in advance... =~= Timothy Casey South Australia worloq@iprimus.com.au Formerly: casey@smart.net.au
9
by: Wang, Jay | last post by:
Hello, all, I would like to enable some text between <SPAN url="http://www.testserver.com/">WORD TO BE DRAGGED </SPAN>. I put some javascript and it will extract http://www.testserver.com/ from...
2
by: Don Wash | last post by:
Hi There! I'm creating my website with ASP.NET + XHTML, which means I will strictly adhere the XHTML standards for my web page output. I use Panel or PlaceHolder WebControls to place...
1
by: shivani anand | last post by:
Hi.. I have a doubt. I have some code.. <span class="test1"> my screeen </span> I simply changed it to. <h2 class = "test1"> my screen </h2>
1
by: rynato | last post by:
I have a <spanof width X px and height Y px. I want to read the text of an article, which is stored in a mySQL table, and pass to that <spanonly just enough text to fit in it, along with a 'read...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.