If you want browser compatibility then you can use the following which I got a while ago
from I don't know where.
//========================
//detect browser settings for showing and hiding DIVs
isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
//========================
function switchDiv(strDivName,bolVi
//identify the element based on browser type
if (isNS4) {
objElement = document.layers[strDivName
} else if (isIE4) {
objElement = document.all[strDivName].s
} else if (isIE5 || isNS6) {
objElement = document.getElementById(st
}
if(isNS4){
if(!bolVisible) {
objElement.visibility ="hidden"
} else {
objElement.visibility ="visible"
}
}else if(isIE4){
if(!bolVisible) {
objElement.visibility = "hidden";
} else {
objElement.visibility = "visible";
}
} else if (isIE5 || isNS6) {
if(!bolVisible){
objElement.display = "none";
} else {
objElement.display = "";
}
}
}
and then
<img src=.... onclick="switchDiv('mydiv'
and on the cancel
<sapn onclick="switchDiv('mydiv'
Main Topics
Browse All Topics





by: SnowFlakePosted on 2006-01-02 at 23:21:59ID: 15596917
use the div's style.visibility and style.display
('mydiv'); el.style.d isplay='bl ock';el.st yle.visibi lity='visi ble';">
('mydiv'); el.style.d isplay='no ne';el.sty le.visibil ity='hidde n';">cance l</span>
values to change its visibility when the image or the cacel are clicked
assuming the div is has an id=mydiv
then
<img src=.... onclick="var el=document.getElementById
and on the cancel
<sapn onclick="var el=document.getElementById