I have an image and a list next to it. I want the image to change to a different source whenever I hover over each item in the list depending on which one it is. For example if I hover over the <div>
"Czech", the image source will change to a map with Czech-speaking areas highlited, but if I hover over the <div>
"Resian" then the image source in the neighboring (website-space-speaking-wise) div will change to a map with areas speaking the Resian dialect of Slovenian highlited.
I’ve tried JavaScript functions and CSS.
3
Answers
Html:
JavaScript:
Css:
You can do this easily by using JavaScript. You need to replace
newImage.jpg
anddefault.jpg
with your src url.CSS:
HTML:
Javascript: