It is necessary to make sure that in the HTML code (in the text of the page itself) certain values of variables appear, which are calculated in the .js file, now I do it like this:
let variable = 123; document.getElementById('variable').innerHTML = variable; <p>Текст в HTML: <span id = variable></span></p>
But it seems to me to be somehow a crutch, since with a large number of variables, the code in js looks very cumbersome, besides, the id value should be unique, so I cannot use the same variable more than 1 time
Tell me the solution
data-[название]
attributes - Vitaly Shebanits