Auto Select and Copy |
Auto Select and Copy |
denmarks |
Jan 17 2008, 05:18 PM
Post
#1
|
Advanced Member Group: Members Posts: 207 Joined: 17-January 08 Member No.: 4,734 |
I have a page that is only used by me and is located on my computer. There is an index at the top with descriptions. When a description is clicked the page repositions using <a> tags to a paragraph with the details. The paragraph is surrounded with the <span> tag.
Is there a way to have the text within the paragraph selected and copied when the index item is clicked to get to the paragraph? I always drag through the data and copy. It would be nice to have it automated if possible. |
Christian J |
Jan 17 2008, 06:50 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
In IE you can use java script:
CODE <a href="#a" onclick="window.clipboardData.setData('Text', document.getElementById('a').firstChild.nodeValue);">link</a> <span id="a">foo</span> assuming the SPAN contains no markup, just plain text, and assuming your security settings permit reading/writing to your clipboard (not recommended on the www for privacy reasons). Other browsers don't support it. |
denmarks |
Jan 18 2008, 12:04 PM
Post
#3
|
Advanced Member Group: Members Posts: 207 Joined: 17-January 08 Member No.: 4,734 |
In IE you can use java script: CODE <a href="#a" onclick="window.clipboardData.setData('Text', document.getElementById('a').firstChild.nodeValue);">link</a> <span id="a">foo</span> assuming the SPAN contains no markup, just plain text, and assuming your security settings permit reading/writing to your clipboard (not recommended on the www for privacy reasons). Other browsers don't support it. Thank you but I need it for Firefox. Any other possibilities? |
Christian J |
Jan 18 2008, 08:02 PM
Post
#4
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
Googling turns up some ideas (that I haven't tested), but they seem to require changes to Firefox: http://www.mozilla.org/projects/security/c...ed-scripts.html
|
Lo-Fi Version | Time is now: 19th April 2024 - 09:28 AM |