Hello Expets,
I am applying the following cs to teh table rows and tds which are under a table with class name "subparent"
Code:
.subparent tr.subhidden td {
padding:3px 0px 3px 10px;background-color:#ffffff;display: none;
}
.subparent tr.subshow td {
padding:3px 0px 3px 10px;background-color:#ffffff;display: block;
}
I dynamically chnage the className using the following javascript code
Code:
function toggleit(parentDiv,imageElement,imgName1,imgName2){
var temp = parentDiv.nextSibling
//parent div is actually the tr above the tr I am trying to chnage the className of.
//temp is the tr of teh table
if(temp.className == "subhidden"){
alert('Equal to subhidden');
temp.className = "subshow";
alert('Changed to '+temp.className)
}
else{
alert('Equal to subshow');
temp.className = "subhidden";
alert('Changed to '+temp.className)
}
imageElement.src=(imageElement.src.indexOf(imgName1) == -1) ?imgName1:imgName2;
parentDiv.focus();
}
Everything works fine if I start from "subshow" as the initial class of the tr the tr is displayed initially and hidden on click, howoever if I start from "subhidden" class for the tr and it is hidden and never goes back to show to tr again even though I have confirmed that the the className chnages to "subshow", can you please let me know what the problem might be?
Thanks.