function working fine in IE but the same funtion is not working for mozilla 3.6

Posted by anand-juventus on Stack Overflow See other posts from Stack Overflow or by anand-juventus
Published on 2010-05-22T10:28:48Z Indexed on 2010/05/22 10:40 UTC
Read the original article Hit count: 219

Filed under:
function VisibleDiv(obj) {
if (obj == BaseLog) {
var objStyle = document.getElementById('DivCalls').style;
if (objStyle.display == "block")
objStyle.display = "none";
else
objStyle.display = "block";
}
else if (obj == ViewReports) {
var objStyle = document.getElementById('DivReports').style;
if (objStyle.display == "block")
objStyle.display = "none";
else
objStyle.display = "block";
}
else if (obj ==Management) {
var objStyle = document.getElementById('DivManage').style;
if (objStyle.display == "block")
objStyle.display = "none";
else
objStyle.display = "block";
}

<a href="#" id="BaseLog" class="TextHeader" onclick="VisibleDiv(this)">Base Log </a>

in the above code is working in IE but not working in mozilla 3.6. I have checked that obj==BaseLog is not working in the above code. I have tried many options like

event.srcelement
window.event.srcelement

but all in vain. when I debug the code ,I found that obj is having complete value for IE but the same obj is having all the names .ie. the name of tag,id and class for "Base Log" seperated by #. i.e a#BaseLog#TextHeader# Please suggest what shoud I do?

© Stack Overflow or respective owner

Related posts about JavaScript