0

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] (:

webbeloz
  • 19
  • 4
  • 5
    I'm sorry, but what?? I have simply **no** idea what you're asking. Please have a read of the [ask] – freefaller Nov 03 '21 at 13:35
  • 1
    What are you exactly trying to achieve? :think: – I am L Nov 03 '21 at 13:36
  • 1
    Please use less jokey/casual English and stick with professional English and spelled out words. For instance, I think "Array prot. forEach" is referring to `Array.prototype.forEach`. There is also no English word "ig" so perhaps that's just a typo, but nonetheless unknown. – Heretic Monkey Nov 03 '21 at 13:42

0 Answers0