Como alterar o texto do parágrafo em clique em java scriopt
<!DOCTYPE html>
<html>
<body>
<p>When you click a button it will change the text of sample paragraph.</p>
<p id="demo">I am sample paragraph.</p>
<button onclick="change_text()">Click me</button>
<script>
function change_text(){
document.getElementById("demo").innerHTML = "You clicked the button, I am new paragraph.";
}
</script>
</body>
</html>
R