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

157
Views
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
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!