select :: Form.Element

select(element) -> HTMLElement

 

Selects the current text in a text input.

 

Example

 

Some search boxes are set up that they auto-select their content when they receive focus.

 

$('searchbox').onfocus = function() {

  Form.Element.select(this)

  // however, much shorter is to just call:

  this.select()

}

 


Prototype API 1.5.0 - prototypejs.org