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

131
Vistas
Array inside an Array and replace value on a className

How much time, (:

"during" is the class to put a value "dur" but ReplaceContentInContainer() inside an Array.prototype.forEach return more class "during". The same with cicle for()

An idea to how to move out vale =>(dur) and if my code is placed correctly? web, All the best


var list = document.querySelectorAll(".media-el audio source");
var els = document.querySelectorAll('.during');

Array.prototype.forEach.call(list, function(el){

var nrc = el.src;

  getDuration(nrc).then(function(length) {

    var attr = document.createAttribute('duration');
    attr.value = length;
    //console.log(attr);
    el.setAttributeNode(attr);
    sleep(1200).then(() => {
      dur = el.getAttribute("duration"); //3object value: 02:24, 03:58, 01:52
      //ReplaceContentInContainer('during', dur); //return => 6 objecy and put only one of each...
    });

   for (var i=0; i < els.length; i++) {
     //console.log(els[i]) //return 6 object
     els[i].innerHTML = dur; //place only first value
   }

});


while if I run it external:


   for (var i=0; i < els.length; i++) {
     console.log(els[i]) //return 3 object Exactly!
     els[i].innerHTML = dur; // but value => dur is undefined
   }

edit=> 05 Nov. 2021 ...it was associated, but to solve it I approached it differently and got the solution in my other question. TnxU [all] (:

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