Avatar of ktwdallas
ktwdallas

asked on 

Adding new options to dropdown works in Firefox, breaks in IE

The following code works perfectly in Firefox, removing old entries from a dropdown and adding two new ones. In IE, it removes the old ones, but gives me a "type mismatch" on IE on the ads.







function changeitems()
{
for(i=$('neighborhood').options.length-1; i>=0; i--)
   $('neighborhood').remove(i);
		
$('neighborhood').add(new Option('--Not Set or n/a--', '-1'),null);
$('neighborhood').add(new Option("--> Other (type on 'other' line)", "-2"),null);
}
 
 
function $(e){if(typeof e=='string')e=document.getElementById(e);return e};

Open in new window

Web BrowsersJavaScriptWeb Development

Avatar of undefined
Last Comment
ktwdallas

8/22/2022 - Mon