09) Change Image

<html>
<body>

<script>

function changeImage() {
	theElement=document.getElementById('myimage')

	if (theElement.src.match("bulbon.gif")) {
		theElement.src="bulboff.gif";
		}
	else {
		theElement.src="bulbon.gif";
		}
	}

</script>

<img id="myimage" onclick="changeImage()" src="bulboff.gif">

</body>
</html>

Leave a Reply

Your email address will not be published.