I am struggling to toggle text visibility using Vanilla JS. Currently, I can only hide the text but cannot figure out how to show it again.
<button id="button">my button</button>
<div>
<p id="text">Hello</p>
</div>
This is the JavaScript code:
const z = document.getElementById('text');
const y = document.getElementById('button');
y.onclick = () => {
z.style.display = 'none';
};