I'm attempting to display an image when hovering over specific text. The image should not replace the text, but appear in a different location.
The concept is as follows: When hovering over the word "Google", the Google logo should appear in the red box, and when hovering over the word "OneNote", the OneNote logo should appear in the red box. Step 1
I attempted to achieve this with the following method:
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>test</title>
</head>
<body>
<img id="img1" onmouseover="setImg()" onmouseout="unSetImg()" src="https://i1.wp.com/www.grapheine.com/wp-content/uploads/2015/09/nouveau-logo-google.gif?fit=1950%2C1200&quality=90&strip=all&ssl=1" width="300">
</body>
<script type="text/javascript">
function setImg(){
document.getElementById("img1").src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSU48ifXX9Kar3IFVrlfwx6UFLqaQno8rCebFvGtwk6yWky9_mz";
}
function unSetImg(){
document.getElementById("img1").src="https://i1.wp.com/www.grapheine.com/wp-content/uploads/2015/09/nouveau-logo-google.gif?fit=1950%2C1200&quality=90&strip=all&ssl=1";
}
</script>
</html>
While this approach works when replacing one image with another, it does not work when trying to replace an image with text.
If anyone can suggest a solution that aligns with my desired outcome, I would greatly appreciate it!
Thank You
Lucas