For this HTML:
<div id="idName" class="className"> ... </div> I know this is correct selector syntax:
div.className {...} div#idName {...} By mistake I did:
#idName.className {...} It seams to work but I don't think it's valid. Can anyone confirm if this is valid?
Edit:
To clarify, this id will be on many pages and, depending on the use of the page, may have different classes.
Page A:
#content.one-column {...} Page B:
#content.two-column {...}
div#myId.selectedIf you're adding / removing the class in javascript. This selector will not work in IE6 so be careful with it.