473,408 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

my IE6 Javascript cannot read select options

Hi
The code below is very simple but it doesn't seem to work correctly in IE6 on my pc (xp sp2). The alerts are blank in IE, all three of them. It works find in FF2 and opera9.5 alpha showing the three select options.
Does it work for you?, what am I doing wrong?
Regards
Wayne

[HTML]<html>
<head><title>test</title>
<script>
function show_sell(){
var elem = document.getElementById("sell");
for(var i = 0; i < elem.length; i++){
alert(elem.options[i].value);
}
}
</script>
<body>
<select id='sell'>
<option>one
<option>two
<option>three
</select>
<input type=button value='click' onclick="show_sell()">
</body>
</html>[/HTML]
Sep 7 '07 #1
3 1230
acoder
16,027 Expert Mod 8TB
Give your options values, e.g.
[HTML]<option value="one">one[/HTML]

Please remember to use code tags when posting code.
Sep 7 '07 #2
Thank you very much for your unbelievably fast assistance.
/Wayne
And I will read up on the code tag!
Sep 7 '07 #3
acoder
16,027 Expert Mod 8TB
Glad to be of assistance. Post again anytime here for your JS problems.
Sep 7 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.