This is an HTML 5 code,and I am using visual studio code . Though ,HTML part is giving output but there is no change in header after applying JavaScript code to it. I don’t seem to understand the problem. Pls help.
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>HTML Page</title>
</head>
<body>
<header id="headerItem"> Old Header </header>
<section>
<button>Click Here</button>
</section>
<script type="text/javascript">
function startLogic() {
var newHtml =
'<em>New Header</em>';
document.getElementById
('headerItem').innerHTML =
newHtml; }
startLogic();
</script>
</body>
</html>