Need help with possible array situation

Need help with possible array situation

Hi all,

My issue today is that I have a search box selector and I'm trying to find a way to:

A)  Find out if there are any values present
B)  If they are present, how many are there ie.. >1
C)  How can I grab all of the values to display?

I have a snippet from the HTML.  I'm thinking I need some sort of For Loop or something along those lines, but I'm not sure how to get it started.  In the case below, I can get it to display the first value "32421" by looking at the ".elem" class, and if it's the only option, but if you select a second option like "33295" and try to display it, it will display  a combination - "3242133295".

What I'm trying to do is find out how to see if there is more than one value (in this case yes) and maybe separate them out by idx.

Example: 0:32421  1:33295



Any help/guidance would be appreciated.