Explore Topics

How to Hide HTML Elements using Javascript?

Last Updated : 18 Apr, 2025 - Asked By Ashok

Here is my HTML code,

<p id="para1">This is paragraph1</p>
<p id="para2>This is paragraph2</p>
<p id="para3>This is paragraph3</p>
<p id="para4>This is paragraph4</p>

How to hide id="para3" using Javascript?

js  hide html elements 

Answers
2024-05-15 06:10:38

 <p id="para1">This is paragraph1</p>

    <p id="para2">This is paragraph2</p>

    <p id="para3">This is paragraph3</p>

    <p id="para4">This is paragraph4</p>

    <script>

    var para = document.getElementById('para3').style.display = 'none';

</script>

Your Answer



Other Resources

Quiz Image
Quiz

Test your knowledge with interactive quizzes.

Interview Questions Image
Interview Questions

Prepare for interviews with curated question sets.

Q&A Image
Q&A

Ask your coding-related doubts and get answers.

Certification Image
Certification

Earn certifications to enhance your resume.

internships Image
Internships

Hands-on projects to improve your skills.

Quiz Image
Quiz

Test your knowledge with interactive quizzes.

Interview Questions Image
Interview Questions

Prepare for interviews with curated question sets.

blog Image
Blogs

Add your technical blogs and read technical topics.

Certification Image
Certification

Earn certifications to enhance your resume.

Q&A Image
Q&A

Hands-on projects to improve your skills.