Jump to content

this.className vs. class:hover


johnnyk

Recommended Posts

Is there any difference between using:

[code]div {
css
}
div:hover {
different css
}

<div>asdf</div>[/code]

AND

[code]div {
css
}
div.different {
different css
}

<div onmouseover="this.className='different'">asdf</div>[/code]

The only differece I know of is that the first one doesn't work in IE6...but fuck IE6 it's a piece of shit (IE makes me angry). Besides that is there any difference?
Link to comment
https://forums.phpfreaks.com/topic/28595-thisclassname-vs-classhover/
Share on other sites

ie 7 supports :hover on all elements and i guess pretty much everyone with ie6 will upgrade within the nxt couple of months - after all theres no reason not to.

Better to not have javascript alter the pages design - just leave js for effects and data checking etc etc. Keep the 'look' of your site to css and you'll have a forwards compatable site that won't break when a new version of the standards compliant browsers are released.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.