Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
How to unhide a hidden html <p> tag element using JavaScript?

I have the following hidden <p> element in the body tag of my HTML file (for my chrome extension).

<p hidden id="button">
    <a id="dashboard-btn" href="www.google.com" target="_blank" rel="noopener noreferrer">
      www.google.com
    </a>
</p>

I want to unhide this using JavaScript. My random try that failed to unhide it:

document.getElementById("button").style.visibility = 'visible';

[SOLVED] This (also) worked:

document.getElementById("button").style.display = "block";
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

You can use removeAttribute

document.getElementById("button").removeAttribute('hidden')
<p hidden id="button">
  <a id="dashboard-btn" 
     href="www.google.com" 
     target="_blank" 
     rel="noopener noreferrer">
      www.google.com
    </a>
</p>

about 4 years ago · Juan Pablo Isaza Denunciar

0

You hide your element with attribute hidden so you need to control that attribute instead of style like:

document.getElementById("button").hidden = false; 
<p hidden id="button">
    <a id="dashboard-btn" href="www.google.com" target="_blank" rel="noopener noreferrer">
      www.google.com
    </a>
</p>

Reference:

  • hidden
about 4 years ago · Juan Pablo Isaza Denunciar

0

Try with this

document.getElementById("button").removeAttribute("hidden")
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda