Line 1: | Line 1: | ||
− | + | <html> | |
<h2>What Can JavaScript Do?</h2> | <h2>What Can JavaScript Do?</h2> | ||
Line 7: | Line 7: | ||
<button onclick="document.getElementById('myImage').src='pic_bulbon.gif'">Turn on the light</button> | <button onclick="document.getElementById('myImage').src='pic_bulbon.gif'">Turn on the light</button> | ||
+ | <html> |
Revision as of 15:19, 23 October 2017
What Can JavaScript Do?
JavaScript can change HTML attributes.
In this case JavaScript changes the src (source) attribute of an image.