WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: Explicit Link Between Radio Buttons and "Question" Label?

for

From: Paul Bohman
Date: Feb 12, 2003 11:26AM


The best way is usually to create a fieldset with a legend. Here is a quick
example:

<fieldset>
<legend>Who is your favorite author?</legend>

<input type="radio" name="au" value="jj" id="jj" />
<label for="jj">James Joyce</label>
<br />
<input type="radio" name="au" value="jfc" id="jfc" />
<label for="jfc">James Fennimore Cooper</label>
<br />
<input type="radio" name="au" value="rwe" id="rwe" />
<label for="rwe">Ralph Waldo Emmerson</label>
<br />
<input type="radio" name="auth" value="ja" id="ja" />
<label for="ja">Jane Austin</label>

</fieldset>

Modern screen readers can associate the legend of the fieldset with the
enclosed contents.

Visual browsers put a box around everything inside of the fieldset.

Paul Bohman
Technology Coordinator
WebAIM (Web Accessibility in Mind)
www.webaim.org
Center for Persons with Disabilities
www.cpd.usu.edu
Utah State University
www.usu.edu