So, I attempted three different ways to make an element disappear completely from the screen (displayed in the code below). Whenever I refresh the page, for each solution I tried, it has a glitch of some sort. By glitch, I mean, when I refresh the site, it shows the original text and quickly takes the text off. I'm wondering if there is a way of preventing this from happening by doing it in some alternative way.
JavaScript:
// WAY 1
document.getElementsByTagName(element)[pos];
thisElement.remove();
// WAY 2
document.getElementsByTagName(element)[pos];
thisElement.style.display = 'none';
// WAY 3
document.getElementsByTagName(element)[pos];
thisElement.style.visibility = 'hidden';