activate :: Form.Element

activate(element) -> HTMLElement

 

Gives focus to a form control and selects its contents if it is a text input.

 

This method is just a shortcut for focusing and selecting; therefore, these are equivalent:

 

Form.Element.focus('myelement').select()

$('myelement').focus().select()

$('myelement').activate()

 

Guess which call is the nicest? ;)


Prototype API 1.5.0 - prototypejs.org