I've got a collection of divs (five in total) with a hidden class applied to them in my CSS stylesheet. Each div also has its own unique ID. My goal is to use JavaScript to reveal these divs one by one.
Here's an example of what I'm looking for:
<style>
.hidden{
display:none; }
</style>
<script>
function displayDiv1(){
document.getElementById('div1').style.display = "block"; }
function displayDiv2(){
document.getElementById('div2').style.display = "block"; }
</script>
<div class="hidden" id="div1">
<p>some stuff here</p>
</div>
<div class="hidden" id="div2">
<p>some more stuff here</p>
</div>
Check out this non-functional jsfiddle http://jsfiddle.net/DAzZT/
Is it feasible to achieve this functionality, or do I have to specify each individual div as hidden by using the ID rather than the class?