.innerText method changes the text in the h2 element but displays nothing in the p tag. Please what am I not doing correctly?
let increaseCount = document.getElementById("counter")
let saveEl = document.getElementById("save-el")
let click = 0
function increment() {
click += 1
increaseCount.innerText = click
}
function save() {
let countStr = click + " - "
saveEl.innertext += countStr
console.log(save)
}
<body>
<div class="container">
<h1>People entered</h1>
<h2 id="counter">0</h2>
<div class="button">
<button id="increment-btn" onclick="increment()">INCREMENT</button>
<button id="save-btn" onclick="save()">SAVE</button>
</div>
<p id="save-el">Previous Entries:</p>
<script src="main.js"></script>
</div>
</body>
change innertext to innerText,
It is not the same, you must be careful with the capital letters