This site is a low down on what's going on in my life, what I'm working on, what I'm thinking about, and how I'm feeling about life in general.

Sunday, 09 March 2008 23:10

The joy of new syntax

Sad I know but some times you come across a rare bit of syntax that most people just don't know about.

Take, for instance <optgroup>.

I recently came across this on a random website, and when I mentioned it in work, no one had heard of it. Now these are all, including myself, guys with 14+ years experience at writing HTML amongst other things.

The annoying thing was the number of times we'd needed something to perform the function of this simple tag, yet floundered and compromised, using some work around or other.

What optgroup does, is simply create a heading within a select list. A non-selectable element that categorises the values below it.To implement this within your select list, just add the following code:

<optgroup label="GMT-10:00"></optgroup>

It's that simple, give it a try. 



Posted in categories:

Tags: Syntax HTML Select optgroup Category Heading

Comments

    Add a comment