Suru code

  • Hi friends how to writing a code JavaScript is the world’s most popular programming language.
  • JavaScript is the programming language of the Web.
  • JavaScript is easy to learn.
  • This tutorial will teach you JavaScript from basic to advanced.c

JavaScript Can Change HTML Content

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”:

Example       document.getElementById(“demo”).innerHTML = “Hello JavaScript”;

What Can JavaScript Do?

What Can JavaScript Do?

JavaScript can change HTML content.


<h2>What Can JavaScript Do?</h2>

<p id=”demo”>JavaScript can change HTML content.</p>

<button type=”button” onclick=’document.getElementById(“demo”).innerHTML = “Hello JavaScript!”‘>Click Me!</button>

</body<!DOCTYPE html>
<html>
<body>

<h2>What Can JavaScript Do?</h2>

<p id=”demo”>JavaScript can change HTML content.</p>

<button type=”button” onclick=’document.getElementById(“demo”).innerHTML = “Hello JavaScript!”‘>Click Me!</button>

</body>
</html<!DOCTYPE html>
<html>
<body>

<h2>What Can JavaScript Do?</h2>

<p id=”demo”>JavaScript can change HTML content.</p>

What Can JavaScript Do?

JavaScript can change HTML content.

Click Me!

What Can JavaScript Do?

JavaScript can change HTML content.

What Can JavaScript Do?

JavaScript can change HTML content.Click Me!

Leave a Comment