this is the sample code in which "hello world" is not displayed. `
<p>This is example </p>
<button id="myBtn" onclick="function1()">Try it</button>
<p id="demo"></p>
<script>
function function1(){
document.write("hii");
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
</body>
</html>
`