java test

By @tuvokhl5/28/2018do

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.

<'button'onclick="document.getElementById('myImage').src='pic_bulbon.gif'">Turn on the light

img id="myImage" src="![pic_bulboff.gif](https://cdn.steemitimages.com/DQmUTHYT5xBY4bQXchTcmjXEtS6YR6CxsAP3uwnaYrhSLky" style="width:100px">

<'button' onclick="document.getElementById('myImage').src='pic_bulboff.gif'">Turn off the light

1

comments