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

104
Vistas
Listen for text changes in all elements with specific class name

I'm trying to run a function the moment text inside any div with a specific class name changes.

See my code below. Here I am trying to listen for text changes in all elements with the class name of "my-item". For some reason this isn't working and I can't figure out what I'm doing wrong.

var TargetItem = document.querySelectorAll(".my-item");
TargetItem.forEach((TargetItemEach) => {
    var TargetText = TargetItemEach.innerHTML;
    TargetText.addEventListener("change", RunMyScript);
}); 
        
function RunMyScript() {
   alert('Hello');
}
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