[thelist] DOM question

Stephen Caudill SCaudill at municode.com
Fri Dec 6 09:54:01 CST 2002


can someone tell me how I would rewrite this reference to a hidden field value to work with the getElementById method?
	document.formName.elementName[randy].value
where [randy] is a function.  Thats the bit I have had trouble with.

This:
	document.getElementById(idName)[random].value
returns an error of "idName has no properties" (javascript console NS7)


here is a snippet of the actual code:

	var randy = Math.round(Math.random() * max)

	function update(){
		BgFade(0xff,0xff,0xff, 0x00,0x33,0x99,10);
			document.getElementById('fader').innerHTML=document.poparray.munipop[randy].value
			randy = Math.round(Math.random() * max)
			setTimeout("update()",speed)
	}

the full source is available at:
 http://neohero.municode.com/munitest

I'm still a newbie with javascript, so it is probably a silly error, but any help is greatly appreciated.


TIA,
Stephen Caudill



More information about the thelist mailing list