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

245
Vistas
Cant read value from function parameter to function getElementById()

I have a problem with HTML and JS... I made a function with parameter, parameter should be ID of HTML element. But my function take that value, and function getElementById can't read that value. I make a test with console log, and I will show you that on image.

JS Function

function HideShowElementDeleteFolder(id){
  var x = document.getElementById(id);
  console.log(x);
  console.log(id);
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
   x.style.display = "none";
  }
}

Calling JS function in HTML

<a class="text-danger" onclick="HideShowElementDeleteFolder('<?php echo $value; ?>')">
   <i class="fas fa-times"></i>
</a>

HTML Element what I want to show on click

<div id="<?php $value; ?>" class="widget-header clearfix" style="display:none;">
    <form action="" method="post">
        <div>
            <a href="dashboard-files.php?folder=<?php echo $value; ?>">
               <button type="submit" class="btn btn-primary mt-2 mb-2">Obrisi folder</button> 
            </a>
        </div>
    </form>
</div>

enter image description here

about 4 years ago · Juan Pablo Isaza
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