I have a code on the site style page (css) to make an animation, but the animation time should vary according to a variable that is in javascript, how do I get the value of this variable to enter into my css code ?
css
div.progresso {
animation: loading "tempo"s ease;
}
javascript
<script >
var som1 = document.getElementById("player");
som1.onloadeddata = function() {
console.log("tempo:" + player.duration + "segundos");;
var tempo = player.duration;
<codigo pra colocar o valor da 'var tempo' naquele lugar especifico do css>
</script>
How could I do this?