Finding a Simpler way
https://code.sololearn.com/W9O2h1GvXw09/?ref=app HTML: <button onclick="show(1)">click 1</button> <button onclick="show(2>click 2</button> <button onclick="show(3)"</button> ..... JS: function show(n){ switch(n){ case 1: document.getElementById("one").style.display="flex"; document.getElementById("two").style.display="none"; document.getElementById("three").style.display="none"; break; case 2: document.getElementById("two").style.display="flex"; document.getElementById("one").style.display="none"; document.getElementById("three").style.display="none"; break; case 3: document.getElementById("three").style.display="flex"; document.getElementById("two").style.display="none"; document.getElementById("one").style.display="none"; break; } } Do you know another way to do the same job in this code. Note: Simpler way means less code lines ;)