It's a simple function, but it's starting to turn a monster, the only thing that changes is the number at the end of each word. Does anyone have any tips on how to shorten this code? Without minify Note: I do not want to decrease the size in KB, but in rows.
function adc_atalho(qm){
if (qm == 1 ) {
document.getElementById("botaoAtalho1").style.display = "none";
document.getElementById("botao1").style.display = "inline";
document.getElementById("btRemover1").style.display = "inline";
}
else if (qm == 2) {
document.getElementById("botaoAtalho2").style.display = "none";
document.getElementById("botao2").style.display = "inline";
document.getElementById("btRemover2").style.display = "inline";
}
else if (qm == 3) {
document.getElementById("botaoAtalho3").style.display = "none";
document.getElementById("botao3").style.display = "inline";
document.getElementById("btRemover3").style.display = "inline";
}
else if (qm == 4) {
document.getElementById("botaoAtalho4").style.display = "none";
document.getElementById("botao4").style.display = "inline";
document.getElementById("btRemover4").style.display = "inline";
}
else if (qm == 5) {
document.getElementById("botaoAtalho5").style.display = "none";
document.getElementById("botao5").style.display = "inline";
document.getElementById("btRemover5").style.display = "inline";
}
else if (qm == 6) {
document.getElementById("botaoAtalho6").style.display = "none";
document.getElementById("botao6").style.display = "inline";
document.getElementById("btRemover6").style.display = "inline";
}
}