This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
element.getElementById is not a function

I have the following code:

Code:

var box = document.getElementById('detail_link');
for (var i=0; i < box.childNodes.length; i++) alert(box.childNodes[ i]);
var frm = box.getElementById('link_form');


The alert runs three times (text, form element, text) but I get an error:
Code:
Error: box.getElementById is not a function
Source file: http://www.scutterman.com/kkids/construction/landing/20100113/scripts/ModuleMethods.js
Line: 244


I'm pretty sure nothing is modifying that element before the script gets to it, and the fact that it has child nodes means it should be part of the DOM and have the method already attached to it.

FF and chrome both have the error, IE and Opera have a different error that I'll have to fix later, and safari I have no idea.

Anyone have any ideas as to why this is happening?

Original page:
http://www.scutterman.com/kkids/construction/landing/20100113/create_ui.php

Javascript:
http://www.scutterman.com/kkids/construction/landing/20100113/scripts/ModuleMethods.js

Oh, and anyone know how to turn off smilies on this board? having a smiley of an i encased in square brackets seems a bit annoying considering the frequency that it gets used in JS

Browser: FF 3.6.6

OS: Windows 7