Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes HTML, CSS and JavaScript and the fly likes Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript "options value" works in Firefox but not in IE" Watch "Javascript "options value" works in Firefox but not in IE" New topic
Author

Javascript "options value" works in Firefox but not in IE

John Zwick
Ranch Hand

Joined: Mar 02, 2009
Posts: 34
The following works in firefox but is not working in IE where I am getting the error:
"Error: 'options' is null or not an object
Code: 0"



How can I get this to work in IE?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
And what does alert(dropDownElement ) tell you?

Eric
Mike Dell
Greenhorn

Joined: Sep 28, 2009
Posts: 10
Eric Pascarello wrote:And what does alert(dropDownElement ) tell you?

Eric


You would get [object] in IE
and [Object HTMLSelectElement] in Firefox

also, correct me if I am wrong but getElementById doesn't work correctly in IE... it also gets the elements with name=id
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Mike Dell wrote:correct me if I am wrong but getElementById doesn't work correctly in IE

It works fine, but it will find things by name as well in a non-standard fashion, so you could say that it's broke. But for finding things by id, it's fine.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript "options value" works in Firefox but not in IE
 
Similar Threads
Checking for load finished
getElementByID not working in Firefox but works in IE?
what to do, if I get error `breaking on JScript rumtime error - object expected
Hiding/Showing div elements using Javascript
Page is Not Refreshing as Expected