HTML JavaScript
The <script> tag is utilized to characterize a customer side content (JavaScript).
The <script> element either contains scripting articulations, or it focuses to an outside content record through the src trait.
Regular uses for JavaScript are image control, shape approval, and dynamic changes of substance.
To choose a HTML element, JavaScript all the time utilize the document.getElementById(id) technique.
This JavaScript case expresses "Hi JavaScript!" into a HTML element with id="demo":
The <script> element either contains scripting articulations, or it focuses to an outside content record through the src trait.
Regular uses for JavaScript are image control, shape approval, and dynamic changes of substance.
To choose a HTML element, JavaScript all the time utilize the document.getElementById(id) technique.
This JavaScript case expresses "Hi JavaScript!" into a HTML element with id="demo":
Example
<script>
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
JavaScript can change HTML styles
document.getElementById("demo").style.fontSize = "25px";
document.getElementById("demo").style.color = "red";
document.getElementById("demo").style.backgroundColor = "yellow";
0 comments:
Post a Comment