faqts : Computers : Programming : Languages : JavaScript : Forms : TextAreas/TextFields

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

39 of 47 people (83%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I select all the text in a text field/area?

Mar 7th, 2000 00:15
Martin Honnen,


Reference the text field/text area e.g.
  var tf = document.formName.fieldName;
then call
  tf.focus();
  tf.select();