I want my button when clicked the first time it starts the game and when I click it again remove h1 element. how can i do?
<button class='btn' onclick='myFunction()'>click on me</button>
function myFunction(){
name = prompt('Your name:');
h1 = document.createElement('h1');
h1.innerText = 'Hi '+name+'!';
document.body.appendChild(h1);
}