I have a series of divs that I've hidden with css display:none;.
<div id="" class="hidden_row">some code</div>
<div id="" class="hidden_row">some code</div>
<div id="" class="hidden_row">some code</div>
I also have button with an onclick "addRow();" function that is designed to sequentially display one hidden row on each click by changing its css declaration to "display:block;". The javascript looks like this:
function addRow(){
var hiddenrow = getElementsByClassName(document, "*", "hidden_row");
for(var i=0; i< hiddenrow.length; i++){
if(hiddenrow[i].style.display = "none"){
hiddenrow[i].style.display = "block";
}
}
}
However, the function doesn't change 1 member of the array on execution (which is what I'd like), it finds the hidden rows and displays them all. How can I tweak my function so that it works as intended?