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

Recently Asked Questions

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.

Python has a variety of libraries such as NumPy, pandas, and matplotlib that make it an ideal language for data analysis and visualization.

Java is commonly used for building enterprise-scale applications.