HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/3822

File a bug

SVNBugCommentTime (UTC)
3822<select> examples2009-09-13 08:59
Index: source
===================================================================
--- source	(revision 3821)
+++ source	(revision 3822)
@@ -40237,7 +40237,46 @@
 
   </div>
 
+  <div class="example">
 
+   <p>The following example shows how a <code>select</code> element
+   can be used to offer the user with a set of options from which the
+   user can select a single option. The default option is
+   preselected</p>
+
+   <pre>&lt;p>
+ &lt;label for="unittype">Select unit type:&lt;/label>
+ &lt;select id="unittype" name="unittype">
+  &lt;option value="1"> Miner &lt;/option>
+  &lt;option value="2"> Puffer &lt;/option>
+  &lt;option value="3" selected> Snipey &lt;/option>
+  &lt;option value="4"> Max &lt;/option>
+  &lt;option value="5"> Firebot &lt;/option>
+ &lt;/select>
+&lt;/p></pre>
+
+  </div>
+
+  <div class="example">
+
+   <p>Here, the user is offered a set of options from which he can
+   select any number. By default, all five options are selected.</p>
+
+   <pre>&lt;p>
+ &lt;label for="allowedunits">Select unit types to enable on this map:&lt;/label>
+ &lt;select id="allowedunits" name="allowedunits" multiple>
+  &lt;option value="1" selected> Miner &lt;/option>
+  &lt;option value="2" selected> Puffer &lt;/option>
+  &lt;option value="3" selected> Snipey &lt;/option>
+  &lt;option value="4" selected> Max &lt;/option>
+  &lt;option value="5" selected> Firebot &lt;/option>
+ &lt;/select>
+&lt;/p></pre>
+
+  </div>
+
+
+
   <h4>The <dfn><code>datalist</code></dfn> element</h4>
 
   <dl class="element">

|