By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,183 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

Selected index with multiple select

P: n/a
In a normal select I can see with selectedIndex which option is selected.

However, I was wondering how I can see the same thing in a multiple select
where more than one option is selected.

Kind regards,
Wim
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Wim Roffal" <wi*************@nospamm-planet.nl> schreef in bericht
news:bs**********@reader11.wxs.nl...
In a normal select I can see with selectedIndex which option is selected.

However, I was wondering how I can see the same thing in a multiple select
where more than one option is selected.


This is done by checking if the item's selected property is set to true:

for (var i = 0; i < obj.length; i++) {
if (obj[i].selected) {
// Item has been selected
}
}
JW

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.