1<button onclick="toggleText()">button</button>
2<p id="Myid">Text</p>
3<script>
4function toggleText(){
5 var x = document.getElementById("Myid");
6 if (x.style.display === "none") {
7 x.style.display = "block";
8 } else {
9 x.style.display = "none";
10 }
11}
12</script>