Forum Moderators: open

Message Too Old, No Replies

Place focus on a link (i.e. <a href>)

Place focus on a link (via JS) after a user initiated event

         

jaymb

8:21 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



I have a simple autotab function that will place focus on another form element once the user has reached the maxlength for a textfield.

In a couple scenarios, the focus needs to be placed on a link (<a href>), not a form element.

Any ideas as to how this would be done would be much appreciated.

Thanks.

Birdman

8:31 pm on Aug 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't done it but I think you can use the id of the anchor to reference it.

document.getElementById["foo"].focus();

<a id="foo" href="....">

jaymb

9:00 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



Works perfect. Thanks.