DEV Community

Discussion on: Add Dynamic Styling to HTML Elements With JavaScript

Collapse
 
peterthompsonnz profile image
Peter Thompson

Reminds me of when JS was used inline in 'the old days' to swap images on mouse over. If my memory serves me correctly the code was something like this:

<IMG SRC="cat1.jpg" onmouseover="JavaScript:this.src='cat2.jpg' onmouseout='javascript:this.src='cat1.jpg'>
Collapse
 
aumayeung profile image
John Au-Yeung

That looks right. It's the most basic introduction. I'm sure most people would use libraries and frameworks to make their lives easier.