SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: document.getElementById
Threaded View
-
Jun 30, 2008, 03:02 #1
- Join Date
- Jun 2008
- Posts
- 49
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
document.getElementById
Hello,
I'd like to ask you, why doesn't this work:
<html>
<head>
<title>getElementById example</title>
<script type="text/javascript">
var target = document.getElementById("para1");
alert(target.nodeName);
</script>
</head>
<body>
<p id="para1">Some text here</p>
</body>
</html>
It says that "target is null". But I don't know why. Can anyone help? Thanks.Last edited by jake.polak; Jun 30, 2008 at 06:12.
Bookmarks