> Again the issue with that is in a single selec box type, even the first open
> is "selected" which is not what i want.
I don't know what you mean by this. Can you say it another way?
The topmost option in a select box need not be regarded as selected.
There is a general consensus among U-As that the topmost option will
be presented as such in the DOM, and thus would be found by the
selector '[selected]'. Thus, you certainly cannot expect the topmost
option to _not_ be selected, as this is common practice and not
explicitly prohibited by W3C standards. But neither can you expect it
to be marked selected in every browser.
The definition of the fake selector ':selected' piggybacks on the live
DOM, not on the raw HTML, just as does the '[selected]' selector. If
there is no option marked selected in the markup, it is up to the U-A
to decide whether the topmost option will be marked selected in the
DOM, or if there will be no selected option at all.
However it decides, the DOM will show the selected option as having
selected=true. That is appropriate, as it is a boolean value. HTML
minimal "selected" or XHTML selected="selected" doesn't change the
type of value in the DOM.
I don't know what your situation is in which ':selected' works
appropriately (whatever that means, it being non-standard and thus for
that exact reason inappropriate!), while '[selected]' does not.
Feel free to update
http://mooshell.net/R6Phb/8
with an example.
-- Sandy