Tweaks following comments from @silviapfeiffer
Changed all occurences of innerText with textContent