What is JavaScript? 
JavaScript is a cross-platform, object-oriented scripting language used to create interactive web pages. JavaScript is the most popular programming language in the world. The following example shows how javascript changes the content of the Html element by using the getElementById() method.
<!DOCTYPE html>
<html>
<body>

<p id="j1">JavaScript can change HTML content.</p>

<button type="button" onclick='document.getElementById("j1").innerHTML = "Hello JavaScript!"'>Click here!</button>

</body>
</html>
Output

JavaScript can change HTML content.