Code:
<html>
<head>
<script>
function imagechanger(myvalue)
{
var resultimg = document.getElementById("resultimage");
var imgsrc=document.getElementById("myvalue").src;
resultimg.src=imgsrc;
}
</script>
</head>
<body>
<img src="1.jpg" id="img1" onclick="imagechanger(img1)" width=100 height=100>
<img src="2.png" id="img2" onclick="imagechanger(img2)" width=100 height=100>
<br>
<!--reasult image-->
<img src="" id="resultimage" width=200 height=200>
</body>
</html>
i dont understand why this doesn't work.please correct this code.
thank you!
Comment