<html>
<body>
<h2>What Can JavaScript Do?</h2>
<p>JavaScript can change HTML attribute values.</p>
<p>In this case JavaScript changes the value of the src (source) attribute of an image.</p>
<button onclick="document.getElementById('myImage').src='img_bulbon.gif'">Turn on the light</button>
<img id="myImage" src="img_bulboff.gif" style="width:100px">
<button onclick="document.getElementById('myImage').src='img_bulboff.gif'">Turn off the light</button>
</body>
<!-- Mirrored from www.w3schools.com/whatis/tryit.asp?filename=trywhatis_js_lightbulb by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:56:09 GMT -->
</html>