I am looking for the javascript that change (image1) to (image2) and then back to (image1) right away when checkbox checked.
I have a code that swap the image when i checked the checkbox and going back to original image when checkbox is unchecked. But I want to change image and going back to original image right way when it checked. Can anyone help?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function changePic(){
if (document.form1.check.checked){
document.picture.src="Images/industry_mrt.jpg";
document.picture.src="Images/industry_ps.jpg";
}
else{
document.picture.src="Images/industry_mrt.jpg";
}}
</script>
</head>
<body>
<img src="Images/industry_ps.jpg" id="picture" name="picture">
<form name="form1" method="post" action="">
<input type="checkbox" name="check" value="checkbox" onClick="changePic();">
</form>
</body>
</html>