I have a div within a div which I'm trying to write a dynamic drop down which you will see from the code below. problem is I am getting an document.getElementById is null error but the div definately exists. Is it something to do with it being within another div?
Code:
for (var x = 1; x <= MaxNights; x++)
{
nights = nights + "<option name=NoNights value="+x+" />"+x
}
document.getElementById("nights").innerHTML= nights;