This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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: 61071
    
  66

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