Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
¿Cómo mostrar un elemento de etiqueta html <p> oculto usando JavaScript?

Tengo el siguiente elemento oculto <p> en la etiqueta del cuerpo de mi archivo HTML (para mi extensión de Chrome).

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

Quiero mostrar esto usando JavaScript . Mi intento aleatorio que no pudo mostrarlo:

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

[SOLUCIONADO] Esto (también) funcionó:

 document.getElementById("button").style.display = "block";
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Puedes usar 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 Report

0

Oculta su elemento con el atributo hidden , por lo que necesita controlar ese atributo en lugar del estilo como:

 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>

Referencia:

  • oculto
about 4 years ago · Juan Pablo Isaza Report

0

Prueba con esto

 document.getElementById("button").removeAttribute("hidden")
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!