• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 131
  • Last Modified:

javascript returns

For a multiple select I have this javascript function:

I need it to return the value of the most recently (last) item clicked.
I see that is scans through the items and returns the first seleted item it finds.

Is it possible to have it return the last item clicked? not the first one it finds?

function changeFunc() {
    var select1 = document.getElementById("armadora");
for (var i = 0; i < select1.length; i++) {
        if (select1.options[i].selected)
            tmpStr = select1.options[i].value;
            
    }
    alert(tmpStr);
    loadXMLDoc();
   }

Open in new window

0
robrodp
Asked:
robrodp
  • 2
  • 2
1 Solution
 
GaryCommented:
Well as I already told you in the previous question you can not do this in IE
0
 
robrodpAuthor Commented:
Gary is right. After some volume testa were made the problem arose
0
 
GaryCommented:
I was trying to get it through to you in the other question
0
 
robrodpAuthor Commented:
Well... we all have our days...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now