views:

13

answers:

2

I have seen on several sites that drop list values can have offsets... For example this drop-list:

 Fruits
   Apple
   Banana
   Orange
 Colors
   Red
   White
   Black

The above are all options, but some have "inlets" or "offsets" or whatever you want to call it. How is this done with js? (regular js, not jquery at the moment)

Thanks If you need more input let me know.

A: 

This is not supported by all browser, and those who does support it requires different techniques.

As far as I remember the methods that work are setting the padding of the option, and prepending spaces (' '). But this only work in a few browsers..

Sean Kinsey
+1  A: 

Are these regular SELECT lists?

In that case, you're talking about <OPTGROUP>

David Hedlund