Hey all,
Sorry, I've tried, but am really stumped here...
The error: "document.getElementById(options[i]) is null"
The code:
You can see the debugging alerts I tried to implement - and it passes all of those measures, it just doesn't seem to want to use the value of options[i] as the id - is there some voodoo going on with getElementById and dynamic objects that I'm anaware of... or... ?
Any help would be greatly appreciated,
Thanks,
TE
Sorry, I've tried, but am really stumped here...
The error: "document.getElementById(options[i]) is null"
The code:
Code:
var options = new Array("blank", "cncOnly", "updosOnly", "mensOnly", "cncUpdos", "cncMens", "updoMens", "allThree", "makeoverCuts", "makeoverHaircolor"); function testToggleMenu(myDiv) { /* var optionsString = ""; for (var j = 0; j < options.length; j++) { optionsString += options[j] + ", "; } */ // alert ("passed div id = " + myDiv + " /// options = " + optionsString + " //"); // alert("options.length = " + options.length); for(var i = 0; i < options.length; i++) { var currentOption = options[i]; if (options[i] == myDiv) { // alert ("Option matched using: " + options[i] + " !"); document.getElementById(options[i]).style.display = "block"; } else { // alert ("Option not matched using: " + options[i] + " !"); document.getElementById(options[i]).style.display = "none"; } } }
Any help would be greatly appreciated,
Thanks,
TE
Comment