I'm trying to learn Javascript and decided to try the innerHTML property myself. But the browser seems to ignore the Javascript code. What am I doing wrong?
<!DOCTYPE html>
<html>
<head>
<title>JavaScript - Document Object Model </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="page">
<h1 id="header">List</h1>
<h2>Buy groceries</h2>
<ul id="todo">
<li id="one" class="hot"><em>fresh</em> figs</li>
<li id="two" class="hot">pine nuts</li><li id="three" class="hot">honey</li>
<li id="four">balsamic vinegar</li>
</ul>
</div>
<script type="text/javascript">
var thirdItem = getElementById('three');
var itemContent = thirdItem.innerHTML;
thirdItem.innerHTML = '<li id="three" class="hot">chicken</li>';
</script>
</body>
</html>
document.getElementById()- you have to call it as a method of thedocumentobject.<li>inside the<li>that's already there - the replacement text should just be"chicken".