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

144
Views
Cómo usar el nombre y el valor del atributo de datos en HTML ligeramente

Tenemos un requisito para obtener el valor del atributo y configurarlo en el archivo de script. Entonces, ¿cómo podemos verificar el nombre del atributo de fecha (id, url, etc.) y establecer el valor en el script de confianza? Por favor verifique y déjeme saber sus pensamientos.

¡Gracias!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

puede usar los métodos getAttribute y setAttribute

por ejemplo

 document.getElementById('element').getAttribute('id') document.getElementById('element').setAttribute('id', 'newId')
about 4 years ago · Juan Pablo Isaza Report

0

Puede usar document.getElementById('element').getAttribute('id') . Cuando el atributo no existe, obtendrá un null .

Entonces puede verificar más tarde si el atributo existe.

 if (document.getElementById('element').getAttribute('id') !== null) { // continue }
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!