You need to define a JavaScript function (which will be called on button click) and access the paragraph to make any change to it.
Here, a working example:
<!DOCTYPE html>
<html>
<script>
function tryme()
{
var d = new Date();
d.setFullYear(2020);
document.getElementById("demo").innerHTML = d;
}
</script>
<body>
<h1>The button Element</h1>
<p id="demo">This is a paragraph. </p>
<button type="button" onclick="tryme()">Click Me!</button>
</body>
</html>