You never want javascript linked to HMTL!  Always add events in an area explicitly designated as javascript.

Basically, you always want HTML to be content;  style goes in a separate css section, functionality goes in a separate javascript section.

It's a pain, but it is vital for maintenance down the line -- you don't want to have to run in circles to find out where the heck the code triggering your "hover" class lives!