Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda