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

304
Vistas
trying to display value returns undefinded

HTML:

<span class="rbx-text-navbar-right text-header" id="nav-robux-amount">11</span>

CODE:

element = document.getElementById("nav-robux-amount")

if (element){
    window.alert(element.value)
}

window.alert shows that the value of element is undefined

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

0

The .value property only exists on inputs. The 'element' isn't a constant variable.

If you want to get the content, you can do the following:

const element = document.getElementById("nav-robux-amount");

if (element) window.alert(element.textContent)

Note: innerHTML is not as good as textContent, as it is vulnerable to attacks.

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