JAVA SCRIPT FUNCTIONS
GET ELEMENT BY ID: One of many JavaScript HTML methods is getElementById() . The example below "finds" an HTML element (with id="demo"), and changes the element content (innerHTML) to "Hello JavaScript": document. getElementById ( "demo" ). innerHTML = "Hello JavaScript" ; JavaScript accepts both double and single quotes. JavaScript Can Change HTML Attribute Values In this example JavaScript changes the value of the src (source) attribute of an <img> tag: <button onclick="document.getElementById('myImage').src='pic_bulbon.gif'">Turn on the light</button> <img id="myImage" src="pic_bulboff.gif" style="width:100px"> <button onclick="document.getElementById('myImage').src='pic_bulboff.gif'">Turn off the light</button> JavaScript Can Change HTML Styles (CSS) Changing the style of an HTML element, is a varia