P
pbeisel
i would like to select the HTML within a DIV when a user clicks in it.
then the user can ctrl-c and get the HTML on the clipboard (much as if
the user drag-selected and area of the page and then hit ctrl-c).
the problem with the drag to select method is that its imprecise or
hard for the user to control. if i could simply select the text for
him, then all he needs to do i click and ctrl-c.
for a standard textbox i simply have an onclick handler set to
'this.select();'. all the user has to do is click on the textbox
(which is a non-editable, meaning read-only) and the text is selected
and then hit ctrl-c and onto the clipboard it goes...
of course, this doesn't work for the DIV.
any ideas?
then the user can ctrl-c and get the HTML on the clipboard (much as if
the user drag-selected and area of the page and then hit ctrl-c).
the problem with the drag to select method is that its imprecise or
hard for the user to control. if i could simply select the text for
him, then all he needs to do i click and ctrl-c.
for a standard textbox i simply have an onclick handler set to
'this.select();'. all the user has to do is click on the textbox
(which is a non-editable, meaning read-only) and the text is selected
and then hit ctrl-c and onto the clipboard it goes...
of course, this doesn't work for the DIV.
any ideas?