faqts : Computers : Programming : Languages : JavaScript : Forms : Radio buttons

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

81 of 98 people (83%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How can you put focus on a radio button ?

Jan 25th, 2002 07:04
Brian Caldwell, Chris Kuhn,


To set focus to a radio button, you must select which group element you 
want the focus set to.

EG: Sex: ()Male ()Female -> both are named sex with values set to 
either male or female.

To set focus to the male button, you would:
form_name.sex[0].focus();

For female, it would be:
form_name.sex[1].focus();