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