Overview
Use for
- JavaScript Can Change HTML Content
- document.getElementById("demo").innerHTML = "Hello JavaScript";
- JavaScript Can Change HTML Attribute Values
- document.getElementById('myImage').src='pic_bulbon.gif
- JavaScript Can Change HTML Styles (CSS)
- - document.getElementById("demo").style.fontSize = "35px";
- JavaScript Can Hide/Show HTML Elements
- - document.getElementById("demo").style.display = "none";
How to include in html document via
-
use <script> document.getElementById("demo").innerHTML = "My First JavaScript"; </script >
-
Placing scripts at the bottom of the body tag element improves the display speed, because script interpretation slows down the display. - in externl files < script> src="myScript.js" </script > can use a full url
libraries / frameworks
- Jquery
- React JS
- Vue.js