My code looks big and clumsy, is there a way to make it smaller? Something like "easier to write", or less?
Here's my example, as you can see, I need to repeat this block 5 times , to display only one button at a time and its <div>
, One for each button I press.
Am I right? would it be anyway?
function analysisShowPage1(){
$('#page01').removeClass('btn-warning').addClass('btn-success');
$('#page02').removeClass('btn-success').addClass('btn-warning');
$('#page03').removeClass('btn-success').addClass('btn-warning');
$('#page04').removeClass('btn-success').addClass('btn-warning');
$('#page05').removeClass('btn-success').addClass('btn-warning');
document.getElementById('analysisFullGraphContainer').style.display = 'block';
document.getElementById('analysisFullGraphContainer2').style.display = 'none';
document.getElementById('analysisFullGraphContainer3').style.display = 'none';
document.getElementById('analysisFullGraphContainer4').style.display = 'none';
document.getElementById('analysisFullGraphContainer5').style.display = 'none';
document.getElementById('copyGraph01').style.display = 'block';
document.getElementById('copyGraph02').style.display = 'none';
document.getElementById('copyGraph03').style.display = 'none';
document.getElementById('copyGraph04').style.display = 'none';
document.getElementById('copyGraph05').style.display = 'none';
}