How might I change an image using javascript
<script>
colorurlMap {
"img 1" : "images/img1.jpg",
"img 2" : "images/img2.jpg",
ect.
}
function
</script>
what would I add to the following function to make the image change as well? EDIT***NEVERMIND I FOUND IT............ THE BELOW WORKS PERFECTLY...THANKS AGAIN
function mouseEnter(el) {
var img = document.getElementById('basehood');
var asrc = document.getElementById('imgLink');
var color = el.getAttribute("data-color");
img.src = colorUrlMap[color];
asrc.href = colorUrlMap[color];
}
<a id="imgLink" href="SAME AS IMG SRC(images/myimg.jpg)"><img id="basehood" src="images/myimg.jpg"> </a>
<div style='width: 65px; height:100px; padding: 5px 8px 5px 8px; float: left;'>
<label for='". $row['uniqueID'] ."' style='cursor:pointer;'>
<img class='inputbox' src='". $row['color_img'] ."' alt='". $row['color_name'] ."' width='60' height='auto'>
<p class='colorpallet'>". $row['color_name'] ."</p>
</label>
<input class="inputbox" id="'. $row['uniqueID'] .'" type="radio" name="finish" onmouseenter="document.getElementById('basehood).src = colorUrlMap[this.value];" value="'. $row['color_value'] .'" onClick="this.form.submit()" style="display:none; cursor:pointer">
Thanks In Advance, I really appreciate your help!