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

155
Vistas
Access to the specific content of an inside code of a script

Please, can anybody tell me how can I access to the value of "41" in this inner script of a website? I just tried this, but it doesnt work

I tried with:

var elem = document.getElementById("back-in-stock-helper");

I only need the number 41, and the example code I need to access is this

<script id="back-in-stock-helper">
  var _BISConfig = _BISConfig || {};
  _BISConfig.product.variants[0]['inventory_quantity'] = 41;
</script>

Thanks!

Solved:

var elem = document.getElementById("back-in-stock-helper");

var elem2 = elem.textContent;

var ult_pos = elem2.lastIndexOf('=');

var stock = elem2.substring(ult_pos);

about 4 years ago · Juan Pablo Isaza
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