There are many solutions to do this, but which solution helps to optimize the source code is important. Please clarify the purpose, explain more clearly
2021-12-27_16-34-15.png 
What I mean is how to remove elements that are not visible to the browser to avoid clicking on them.
Thanks.