Answers for "javascript change image onclick"

0

js code to change a immage

<script type="text/javascript">
    function changeImage(a) {
        document.getElementById("img").src=a.src;
    }
</script>
<div id="main_img">
    <img id="img" src="1772031_29_b.jpg">
</div>
<div id="thumb_img">
    <img src='1772031_29_t.jpg'  onclick='changeImage("1772031_29_b.jpg");'>
    <img src='1772031_55_t.jpg'  onclick='changeImage("1772031_55_b.jpg");'>
    <img src='1772031_53_t.jpg'  onclick='changeImage("1772031_53_b.jpg");'>
</div>
Posted by: Guest on December-07-2020
0

how to change image on mouse click in javascript

<img src="imageName1.jpg" onmouseover="imagefun()" id="getImage">
Posted by: Guest on July-16-2020

Code answers related to "javascript change image onclick"

Code answers related to "Javascript"

Browse Popular Code Answers by Language