...

View Full Version : "Select all" button for .html page



fallencmd
07-18-2010, 01:33 PM
Hi guys what i'm trying to do without sucess , can't find anything on google.. Is trying to arrange a button to do a "CTRL+T" (Select all) effect in the HTML i'm currently viewing. Is this possible in Javascript?

I dont want to select the text in a textbox ! I want it in the whole .html i'm currently viewing.


Cheers

fallencmd
07-18-2010, 08:48 PM
anyone?

Old Pedant
07-19-2010, 07:57 PM
Not really, though you can perhaps get the same *effect*. For example, you could (in MSIE at least, not sure about other browsers) copy all the HTML into the clipboard. Effectively, doing CTRL-A CTRL-C.

gusblake
07-19-2010, 09:47 PM
In IE you have document.body.createTextRange().

http://www.webreference.com/js/column12/index.html

Old Pedant
07-19-2010, 11:17 PM
Ahhh...didn't realize a text range could include entire body. Nice.

Of course, still an IE only answer.

fallencmd
07-20-2010, 09:32 PM
Hi guys , thanks for the reply. I actually had to change de structure of me website so that code i wanted became obsolete for now .. i want to refresh only a text area box, any ideas if this is possible?

Old Pedant
07-20-2010, 09:42 PM
???

document.NameOfForm.NameOfTextArea.value = "whatever you want";

???

I don't see what "refresh a text area box" has to do with "select all"???



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum