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

143
Vistas
How to use data attribute name and value in HTML-slightly

We have a requirement to get the attribute value and set it in the script file. So , How can we check the date-attribute-name(id, url, etc..) and set the value in the one trust script. Please verify and let me know your thoughts.

Thanks!

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

you can use getAttribute & setAttribute methods

for example

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

0

You can use document.getElementById('element').getAttribute('id'). When the attribute not exists you will get a null.

So you can check later whether the attribute exists.

if (document.getElementById('element').getAttribute('id') !== null) {
   // continue
}
about 4 years ago · Juan Pablo Isaza Denunciar
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