Creating a header from a prompt

How can i use a value entered through a prompt and put it inside an h1 element when i press a button

<html>
<body>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
  
  var h = document.createElement("h1")    
  var t=prompt("Pick a new title:");
  var p=document.createTextNode(t)
  h.appendChild = p;
  document.body.appendChild(h);

}
</script>

</body>
</html>

This line is the problem:

h.appendChild = p;

That’s not how the .appendChild method works, see here: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild