J
Jan Doggen
Hello,
The following code displays the name for all three elements in IE, but fails
for the1st and 3rd in Firefox.
What could be going on?
I tried SPAN instead of DIV doesn;t work either.
(What I finally want is to set style.invisibility for the text in that DIV)
TIA
Jan
<HTML>
<BODY onload="Init()">
<script type="text/javascript">
function Init()
{
if (document.all)
var msg = 'document.all OK'
else
var msg = 'document.all N/A';
if (document.getElementById)
alert(msg + '\ndocument.getElementById OK')
else
alert(msg + '\ndocument.getElementById N/A');
var divm = document.getElementById("menu");
if (divm)
msg = 'getelementbyid(menu): ' + divm.name
else
msg = 'getelementbyid(menu): N/A';
var ff = document.getElementById("varProfBevoegdheden");
if (ff)
msg = msg + '\ngetelementbyid(varprofbevoegdheden): ' + ff.name
else
msg = msg + '\ngetelementbyid(varprofbevoegdheden): N/A';
var divi = document.getElementById("bvtext");
if (divi)
msg = msg + '\ngetelementbyid(bvtext): ' + divi.name
else
msg = msg + '\ngetelementbyid(bvtext): N/A';
alert(msg);
}
</script>
<div id="menu" name="menu">
<table>
<tr><td>Zoeken 1</td></tr>
<tr><td>Zoeken 2</td></tr>
</table>
</div>
<table>
<tr>
<td>
<div id="bvtext" name="bvtext">Bevoegdheid:</div>
</td>
<td>
<select id="varProfBevoegdheden" name="varProfBevoegdheden" size="4">
<OPTION VALUE="1">Geen voorkeur\n.v.t.
<OPTION VALUE="2">1e graads
<OPTION VALUE="4">2e graads
</select>
</td>
</tr>
</table>
</BODY>
The following code displays the name for all three elements in IE, but fails
for the1st and 3rd in Firefox.
What could be going on?
I tried SPAN instead of DIV doesn;t work either.
(What I finally want is to set style.invisibility for the text in that DIV)
TIA
Jan
<HTML>
<BODY onload="Init()">
<script type="text/javascript">
function Init()
{
if (document.all)
var msg = 'document.all OK'
else
var msg = 'document.all N/A';
if (document.getElementById)
alert(msg + '\ndocument.getElementById OK')
else
alert(msg + '\ndocument.getElementById N/A');
var divm = document.getElementById("menu");
if (divm)
msg = 'getelementbyid(menu): ' + divm.name
else
msg = 'getelementbyid(menu): N/A';
var ff = document.getElementById("varProfBevoegdheden");
if (ff)
msg = msg + '\ngetelementbyid(varprofbevoegdheden): ' + ff.name
else
msg = msg + '\ngetelementbyid(varprofbevoegdheden): N/A';
var divi = document.getElementById("bvtext");
if (divi)
msg = msg + '\ngetelementbyid(bvtext): ' + divi.name
else
msg = msg + '\ngetelementbyid(bvtext): N/A';
alert(msg);
}
</script>
<div id="menu" name="menu">
<table>
<tr><td>Zoeken 1</td></tr>
<tr><td>Zoeken 2</td></tr>
</table>
</div>
<table>
<tr>
<td>
<div id="bvtext" name="bvtext">Bevoegdheid:</div>
</td>
<td>
<select id="varProfBevoegdheden" name="varProfBevoegdheden" size="4">
<OPTION VALUE="1">Geen voorkeur\n.v.t.
<OPTION VALUE="2">1e graads
<OPTION VALUE="4">2e graads
</select>
</td>
</tr>
</table>
</BODY>