views:

35

answers:

2

Prototype's activate function

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

according to the Prototype website. i.e.

$('my_element_id').activate();

What is the equivalent function in jQuery?

+5  A: 
$('#my_element_id').focus();

which is a shortcut for

$('#my_element_id').trigger('focus');

http://api.jquery.com/focus/

jAndy
+2  A: 
$('my_element_id').focus();
Dave Swersky