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

277
Views
Cómo mostrar/ocultar una etiqueta td después de ocultarla

Oculto una etiqueta td pero no puedo mostrarla después, así que me pregunto cuál es ese problema.

Dibujo la etiqueta td usando javascript y cuando el usuario seleccione la opción en la lista desplegable, qué clase se selected_option decidirá la visibilidad de la misma.

El problema es que el td no se puede ocultar ni mostrar a pesar de que cambié la opción seleccionada.

 tempHtml += '<td id="lang-capvariable"><input type="text" class="w3-input"></td>'; $('.selected_option').change(function(){ let option = $(this).val() let showvariable=false; switch(option){ case(show): showvariable=true; break; case(hide): showvariable=false; break; default: showvariable=false; break; } if(showvariable==true){ $('#lang-capvariable').show() }else{ $('#lang-capvariable').hide() } }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Intenta mostrar toda la tabla

 <table> <tr><td>1</td><td>1</td><td>1</td></tr> <tr><td>1</td><td>1</td><td>1</td></tr> <tr><td>1</td><td id=ChangeMe>0</td><td>1</td></tr> <tr><td>1</td><td>1</td><td>1</td></tr> </table> <button id=ShowHide>Show / Hide</button> <script src=Code.js></script>

Código.js

 function ChangeVisibility() { if(document.getElementById("ChangeMe").style.display=='none') { document.getElementById("ChangeMe").style.display='block'; } else { document.getElementById("ChangeMe").style.display='none'; } } document.getElementById("ShowHide").addEventListener("click",ChangeVisibility); ChangeVisibility();

Cargue javascript y oculte el elemento td al final de javascript si necesita comenzar con el ancho oculto td.

about 4 years ago · Juan Pablo Isaza Report

0

siempre está oculto porque le agregaste el atributo oculto. Necesitas quitarlo.

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!