I'm not sure I understand your question, but what about something like this:

var itemname1, itemname2;
$('.list-item').each(function(){
  if (this.innerHTML.match(/Item Name/))
      itemname1 = this;
  if (this.innerHTML.match(/Item Name 2/))
      itemname2 = this;
});

-- dz



On Sun, Feb 22, 2009 at 6:38 AM, rhhhmon <[email protected]> wrote:
>
> Hey guys,
>
> So here's my problem. I want to scan the whole page of the website.
> I'm trying to locate 2 datas, then I will put each data into a
> separate variable.
>
> var listitem, thislist, itemname1, itemname2;
> listitem = getElementsByClass('-list-item');
> for(var i = 0; i < listitem.length; i++) {
>        if(listitem[i].innerHTML.match(/Item Name:/)) {
>                itemname1 = listitem[i];
>        }
>
> }
>
> When the for loop scanned the whole -list-item class, and if it find
> the Item Name: string then it will put that to itemname1. However,
> there's another Item Name: string in the website. So I need to put the
> other one to itemname2.
>
> I don't know how to do that. I'm pretty newbie boss! Please tell me
> how to do that and I'll remember it forever!
>
> Raymond
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to