Two Laptop Bag*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 61106
    
  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]
 
 
subject: Javascript "options value" works in Firefox but not in IE