<html>
<head>
<title>Using innerHTML property</title>
<script>
function addText()
{
document.getElementById("msg").innerHTML = "Welcome to Studytonight";
}
</script>
</head>
<body>
<p id="msg">Hey there!</p>
<button type="button" onclick="addText()">Click me!</button>
</body>
</html>