Horje

Full Example of The HTML <script> Tag

This JavaScript example writes "Hello JavaScript!" into an HTML element with id="demo":
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Use JavaScript to Change Text</h2>
<p>This example writes "Hello JavaScript!" into an HTML element with id="demo":</p>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script> 

</body>
</html>

Output should be:

Full Example of The HTML <script> Tag



Single Articles
Full Example of The HTML <script> TagHTML JavaScript


Related Articles
What is HTML JavaScript HTML JavaScript
How to use The HTML <script> Tag HTML JavaScript
How to create A Taste of JavaScript HTML JavaScript
How to create The HTML <noscript> Tag HTML JavaScript

Type:
Html
Category:
Web Tutorial
Sub Category:
HTML JavaScript
Uploaded by:
Admin



Share on: