I have created simple javascript program. When I click on div tag it opens prompt dialog accept text from user, create div and display text above created div. Now my problem is I want to display prompt text in h1. I used this method to display text in h1 "newDiv.style = "h1";" But that doesn't work. Can anyone help me with this ?

code:

```js
window.onload = function() {
  var x = document.getElementById("div1");
  x.onclick = function() {
    var mvytext = prompt("Enter text");

    var parent = mvytext.parentNode;
    var newDiv = document.createElement("div");
    newDiv.id = "myNewDiv";
    newDiv.className = "cdiv1";
    newDiv.style = "h1";

    var txt = document.createTextNode(mvytext);
    newDiv.appendChild(txt);

    var beforeMe = document.getElementsByTagName("div")[0];

    document.body.insertBefore(newDiv, beforeMe);

  }
}
```

```css
#div1 {
  background-color: yellow;
}

.cdiv1 {
  background-color: #bdefb8;
  width: 50%;
  height: 100px;
  padding: 10px;
  margin: 10px 0;
  border: 4px solid;
  border-color: red;
}
```

```html
<div style="width: 50%;height: 100px;padding: 10px;margin: 10px 0" id="div1">
  <h1>Click me to add a new movie. </h1>
</div>
```