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

331
Views
cómo cambiar el atributo "oculto" en jquery
<td> <input id="check" type="checkbox" name="del_attachment_id[]" value="<?php echo $attachment['link'];?>"> </td> <td id="delete" hidden="true"> the file will be deleted from the newsletter </td>

Quiero saber cómo puedo cambiar el atributo "oculto" a falso en Jquery cuando la casilla de verificación está marcada o no.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

$(':checkbox').change(function(){ $('#delete').removeAttr('hidden'); });

Tenga en cuenta que, gracias al consejo de A.Wolff , debe usar removeAttr en lugar de configurarlo como falso. Cuando se establece en falso, el elemento seguirá estando oculto. Por lo tanto, la eliminación es más eficaz.

over 4 years ago · Santiago Trujillo Report

0

Puedes usar el método jquery attr

 $("#delete").attr("hidden",true);
over 4 years ago · Santiago Trujillo Report

0

A. Wolff te estaba guiando en la dirección correcta. Hay varios atributos en los que no debe establecer un valor de cadena. Debe alternarlo con un valor booleano true o false .

.attr("hidden", false) eliminará el atributo de la misma manera que se usa .removeAttr("hidden") .

.attr("hidden", "false") es incorrecto y la etiqueta permanece oculta.

No debe establecer hidden , checked , selected o varios otros en ningún valor de cadena para alternarlo.

over 4 years ago · Santiago Trujillo 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!