L
libsfan01
Hi all
This js i wrote to switch display on and off of a given element does
not work in ie but it does in ff and safari.
how can i make it work with ie guys?
<script type='text/javascript'>
function switch_display(switchme) {
curr_el = document.getElementById(switchme);
curr_dis = curr_el.style.display;
if (curr_dis != 'none') {
hidethis(curr_el);
}
if (curr_dis == 'none') {
showthis(curr_el);
}
return;
}
function hidethis(curr_el) {
curr_el.style.display = 'none';
}
function showthis(curr_el) {
curr_el.style.display = 'inherit';
}
</script>
<input type="button" onClick="switch_display('testdiv');" value="button
to switch display">
<div id="testdiv">some text
</div>
This js i wrote to switch display on and off of a given element does
not work in ie but it does in ff and safari.
how can i make it work with ie guys?
<script type='text/javascript'>
function switch_display(switchme) {
curr_el = document.getElementById(switchme);
curr_dis = curr_el.style.display;
if (curr_dis != 'none') {
hidethis(curr_el);
}
if (curr_dis == 'none') {
showthis(curr_el);
}
return;
}
function hidethis(curr_el) {
curr_el.style.display = 'none';
}
function showthis(curr_el) {
curr_el.style.display = 'inherit';
}
</script>
<input type="button" onClick="switch_display('testdiv');" value="button
to switch display">
<div id="testdiv">some text
</div>