js display show code example
Example 1: html button that hide and show
<button onclick="toggleText()">button</button>
<p id="Myid">Text</p>
<script>
function toggleText(){
var x = document.getElementById("Myid");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
Example 2: js display
Check this! https://dev.to/devlorenzo/js-hide-and-show-32og
Example 3: toggle element javascript
document.querySelector("#test").hidden = true;
document.querySelector("#test").hidden = false;
Example 4: how to display ä in js