i'm trying to use javascript to add new content on a button click.
I have got the javascript to work if the button is clicked once but i would like to have it so every time i press the button a new 'hello world' will be created.
<button id="myBtn">Try it</button>
<p><strong>Note:</strong> The addEventListener() method is not
supported in Internet Explorer 8 and earlier versions.</p>
<p id="demo"></p>
<script>
document.getElementById("myBtn").addEventListener("click", function(){
document.getElementById("demo").innerHTML = "Hello World";
});
</script>
Thanks in advance