alcatraz678
09-13-2008, 04:34 AM
hey guys, I'm a new javascript programmer, i need some help in DOM. I'm having problem with this code, it didn't work out as i planned it to be. the problem is my document.getElementById("baldwins"); is not working in firefox. Firefox doesn't detect the codes, or id.
It's a simple problem, a lot of you guys know this already, I assume..
baldwins = document.getElementById("baldwins");
if (baldwins) {
alert("there is baldwins");
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml" lang = "en-US">
<head>
<title>Simply Javascript</title>
<meta http-equiv = "Content-Type" content = "text/html; charset = utf-8" />
<script type = "text/javascript" src = "minelabs.js"></script>
</head>
<body>
<ul name="baldwins" id="baldwins">
<li id="im>
Alec
</li>
<li>
Daniel
</li>
<li>
William
</li>
<li>
Stephen
</li>
</ul>
</body>
</html>
It's a simple problem, a lot of you guys know this already, I assume..
baldwins = document.getElementById("baldwins");
if (baldwins) {
alert("there is baldwins");
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml" lang = "en-US">
<head>
<title>Simply Javascript</title>
<meta http-equiv = "Content-Type" content = "text/html; charset = utf-8" />
<script type = "text/javascript" src = "minelabs.js"></script>
</head>
<body>
<ul name="baldwins" id="baldwins">
<li id="im>
Alec
</li>
<li>
Daniel
</li>
<li>
William
</li>
<li>
Stephen
</li>
</ul>
</body>
</html>