0
El.style doesn't work
Hi, Why won't this code move my element? window.onload = () =>{ function addTextEl(x){ let a = document.createElement('span'); a.innerHTML = 'š„' document.body.appendChild(a) a.style.left = x } addTextEl(0) addTextEl(50) } I'm using basic HTML, CSS design, no changes at all. This code produces the text in same location ALWAYS, (2 'š„' always one by the other, even when I change x) why??
5 Answers