f



Can JavaScript select text in a text-field?

Hi,

I would like to have a text-field (in html form) with a selected text.
In other words, it user loads the form, he/she can see a text in the
text field (this text should explain  what should be put in the text
field). It is convenient to have a selected text, so that it user
start to write something in the text filed the selected text will be
immediately deleted.

Thank you in advance for any help.
0
Kurda
1/20/2009 1:07:05 AM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

1 Replies
535 Views

Similar Articles

[PageSpeed] 20

On 2009-01-20 02:07, Kurda Yon wrote:
> I would like to have a text-field (in html form) with a selected text.

You can use fieldElement.focus() and fieldElement.select().


  - Conrad
0
Conrad
1/20/2009 1:12:20 AM
Reply: