I have seen on several sites that drop list values can have offsets... For example this dr开发者_开发知识库op-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.
Are these regular SELECT
lists?
In that case, you're talking about <OPTGROUP>
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..
精彩评论