hello,
Question, on page load, I populate an existing drop down with
createElement and appendChild. It works fine so far. BUT I want to
automatically select some option from this populated drop down. So i
have this statement:
document.getEle mentById("dropd own").options[someindex].selected=true;
And it gives me an error.
Surprisingly, when i put an alert statement before appending the
created element to dropdown, the error doesn't occur.
Can anyone help please?
Thanks
Question, on page load, I populate an existing drop down with
createElement and appendChild. It works fine so far. BUT I want to
automatically select some option from this populated drop down. So i
have this statement:
document.getEle mentById("dropd own").options[someindex].selected=true;
And it gives me an error.
Surprisingly, when i put an alert statement before appending the
created element to dropdown, the error doesn't occur.
Can anyone help please?
Thanks
Comment