Horje

Basic Example of A Taste of JavaScript

JavaScript can change content:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>My First JavaScript</h1>

<p>JavaScript can change the content of an HTML element:</p>

<button type="button" onclick="myFunction()">Click Me!</button>

<p id="demo">This is a demonstration.</p>

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

</body>
</html>

Output should be:

Basic Example of A Taste of JavaScript




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