
September 28th, 2003, 04:55 PM
|
|
|
|
Join Date: Apr 2007
Location: England
Posts: 271
Time spent in forums: < 1 sec
Reputation Power: 3
|
|
|
Trouble with div and css events
Hi all,
Yet again I've come across another something that runs on one browser on not another :laugh:
This works on IE6, but fails miserably under Mozilla (and most likely Netscape as well - untested)
Code:
<select name=share_date OnChange="swap(date_panel)">
blah blah blahdy blah
<div id="date_panel" style="display:'none;'">
blah blah blahdy blah
</div>
and the javascript that runs it is simply:
Code:
function swap(ctrl) {
if (ctrl.style.display == "none") {
ctrl.style.display = "";
} else {
ctrl.style.display = "none";
}
}
does anyone know a similar idea that will work for Mozilla & Netscape (if needed), or something that will work for all three browsers without two code pieces dependant on browser type?
Thanks, J
|