Problem Statement:

Create a web page which displays a light bulb image. Below the image display two buttons ON and OFF. When the user clicks ON button, the image (bulb) should glow and when the user clicks OFF button, the image (bulb) should return back to off state. (Hint: Grab two images of a light bulb, one represents ON state and the other represents OFF state. Change the images on the webpage using DHTML)

Source Code:

ex9.html

ex9script.js

Output:

Click here for output