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

198
Vistas
How can I get this timer script to function within a html/js element in ClickFunnels?

I've been trying to figure out how to get this to work in a single HTML/JS element in ClickFunnels.

I need to use a div tag instead of body tag but unfortunately I cannot use onLoad with divs as I've recently discovered.

I would highly appreciate any help on this as I've already spent a few hours trying to figure this out.

Here is the HTML

<body onLoad="startCount();">
     
    <span class="timerz">Spots remaining: <span id="counterz">19</span></span>
     
</body>

Here is the JS

<script>
var timer;

function startCount() {
  timer = setInterval(count, 500); // 200 = 200ms delay between counter changes. Lower num = faster, Bigger = slower.
}

function count() {
  var rand_no = Math.ceil(3 * Math.random()); // 9 = random decrement amount. Counter will decrease anywhere from 1 - 9.
  var el = document.getElementById("counterz");
  var currentNumber = parseFloat(el.innerHTML);
  var newNumber = currentNumber - rand_no;
  if (newNumber > 0) {
    el.innerHTML = newNumber;
  } else {
    el.innerHTML = "1"; // This message is displayed when the counter reaches zero.
  }
}
</script>
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