All 1 entries tagged HTML

View all 10 entries tagged HTML on Warwick Blogs | View entries tagged HTML at Technorati | There are no images tagged HTML on this blog

February 16, 2007

<optgroup>

I've just found a useful HTML element that I hadn't come accross before: <optgroup>.

It's used in drop-down lists in forms to create categories that aren't selectable, for example:

<select>
  <optgroup label="Odd">
    <option value="1">One</option>
    <option value="3">Three</option>
    <option value="5">Five</option>
  </optgroup>
  <optgroup label="Even">
    <option value="2">Two</option>
    <option value="4">Four</option>
    <option value="6">Six</option>
  </optgroup>
</select>

would give:

So, hours of endless fun and entertainment...


March 2023

Mo Tu We Th Fr Sa Su
Feb |  Today  |
      1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31      
RSS2.0 Atom

Search this blog

Twitter

Google PageRank

Tags

Not signed in
Sign in

Powered by BlogBuilder
© MMXXIII