There is something wrong with this code.
HTML
<p id = "Krishna"></p>
JavaScript
document.getElementById("Krishna").innerHTML = "Hello"
There is something wrong with this code.
HTML
<p id = "Krishna"></p>
JavaScript
document.getElementById("Krishna").innerHTML = "Hello"
You are not calling your script in the code above. I use the same code with a function:
<script>
function fun(){
document.getElementById("Krishna").innerHTML = "Hello";
}
</script>
</head>
<body onload='fun()'>
<p id = "Krishna"></p>
</body>
I hope it works for you.