You should avoid both inline styling and inline javascript and instead place a listener in your javascript file and do the styling through class or id selectors.