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