Waiting Answer March 23, 2024

How to Show Hidden HTML Elements using Javascript?

Here is my HTML code

    <p id="para" style="display:none;">This is a HTML code</p>
    <button type="button">Click Here to change the p tag Font Size</button>

I want to show the id para when clicking the button. How to do this using Javascript?

Answers
2024-05-15 06:24:01

   

<p id="para" style="display:none;">This is a HTML code</p>

<button type="button" onclick="show()">Click Here to show the hidden paragraph</button>

 

<script>

  function show() {

    var s = document.getElementById('para');

    para.style.display = 'block';

  }

</script>

Your Answer