...

View Full Version : document.getElementById(msg) is null



sonic656
09-28-2011, 08:19 PM
Hi....I have an error in my script, but idk where it is..... here is the script:



<script type="text/javascript">
var browser = navigator.appName;
if (browser=="Netscape") {
document.getElementById(msg).style.display="none";
}
</script>
<div id="msg" style="width:100%;padding:3px;position:fixed;top:0px;left:0px;background:red;">Please install <a href="http://www.mozilla.org/sk/firefox/">Mozilla Firefox</a> to view this page normally.</div>

blaze4218
09-28-2011, 08:23 PM
document.getElementById('msg').style.display="none";

DanInMa
09-28-2011, 09:01 PM
also the script block should be after the div element in this example.

sonic656
09-28-2011, 09:05 PM
:( not working with:
document.getElementById('msg').style.display="none";

sonic656
09-28-2011, 09:23 PM
also the script block should be after the div element in this example.

THX MAN!!!!! it is working!!! your great!

blaze4218
09-28-2011, 09:34 PM
In all fairness you needed both changes for your code to work ;)

sonic656
09-29-2011, 04:59 PM
Thx for help

sonic656
09-29-2011, 05:01 PM
<?php

echo "Thank you blaze4218";

?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum