What Can JavaScript Do?

JavaScript can change HTML attribute values.

In this case JavaScript changes the value of the src (source) attribute of an image. When you click on the on/off buttons The light bulb turns on and off. The Java script buttons substitutes an image of an bulb thats turned on for one that is turned off. The initial state shows the bulb off, clicking on the on button turns it on. Refreshing the page will return it to the initial state.

Return to the Main Page