Question:You have written the following function to change the source of an image at runtime: function changeimg(givenImg) { document.getElementById('imageID').src=givenImg } You would like the source of the image to change to "image2.gif" only for the time that the user clicks on the image. Which of the following will you use? 

A 
<img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)">
 

B 
<img id="imageID" src="image1.gif" width="50" height="60" onmouseclick="changeimg(image2.gif)" onmouseup="changeimg(image1.gif)">
 

C 
<img id="imageID" src="image2.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)">
 

D 
<img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg('image2.gif')" onmouseup="changeimg('image1.gif')">
 

+ Answer
+ Report
Total Preview: 850

Copyright © 2024. Powered by Intellect Software Ltd