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

173
Vistas
Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') chrome extention

I'm trying to build this chrome extention that alerts you once the timer is done and it should be automatic. However I'm keep getting the errors

Uncaught ReferenceError: timer is not defined

Uncaught TypeError: Cannot set properties of null (setting 'innerHTML')

var startingMinutes = 30;
let time = startingMinutes * 60;


setInterval(function () {
const timer = document.getElementById('timer');
const minutes = Math.floor(time / 60);
let seconds = time % 60;
seconds = seconds < 10 ? '0' + seconds : seconds;
timer.innerHTML = `${minutes}:${seconds}`;
time--;
time = time < 0 ? 0 : time;
if (time == 0) {
    fn();
    time = startingMinutes * 60;
    return;
}

function fn() {
    alert("!")
  }
}, 1000);
about 4 years ago · Santiago Gelvez
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