I wouldn't be surprised if I'm making this more complicated then it needs to be.

I have a checkbox that when checked will display many images in a table (that part actually works). BTW, this table is created in the code behind. The problem is when you deselect the checkbox, the images still show.


JAVASCRIPT:

function arrows(chkd)
{
var trs = document.getElementsByTagName("img");
for (var i=0; i<trs.length; i++) {
if (trs[i].className.match(/hide/))
{
trs[i].className = (chkd)? trs[i].className.replace(/hide/, "show") : trs[i].className.replace(/show/, "hide");
}
}
}

CHECKBOX
<asp:CheckBox ID="ArrCheck" runat="server" Checked="false" />

CODE BEHIND

ArrCheck.Attributes.Add("onclick", "arrows(this.checked);")