JS DOM programs collection
JS program to To change the contents after clicking, using getElementById (DOM)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DOM concept</title>
</head>
<body>
<p id='p1'>hello world, you are beautiful.</p>
<button onclick="textChange();">click to change the text</button>
<script>
function textChange()
{
document.getElementById("p1").innerHTML="this is a new text";
}
</script>
</body>
</html>