JavaScript ukryj wszystkie elementy oprócz jednego

const allElements = document.body.getElementsByTagName('*');
for(const elem of allElements){
	if(elem.className !== "") elem.remove(); // I used className here, any selector goes!
}
I_Like_Cats__