+ Reply to Thread
Results 1 to 2 of 2

how to loop in general and then apply .getelementsbyID

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    how to loop in general and then apply .getelementsbyID

    Hello,

    I have the following HTML code:

    <td width="10%" height="20" align="center" class="data" id="requirement0" bgColor="#eeeecc">
    Text - DOCIMG
    .getelementbyid("Requirement0).innertext
    The html page displays 40 requirements, so each one's ID is named requirement0, requirement1, requirement2, etc, until requirement39. I need to check if certain text is occuring inside these. How do I loop this so that it adds one each time to the getelementbyid tag, checking the inner text for a parameter, lets say DOCIMG like above?

  2. #2
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    MS-Off Ver
    MSO 2K3, 2K10
    Posts
    84

    Re: how to loop in general and then apply .getelementsbyID

    Dim i As Integer
    
    For i = 0 to 39
      xxx = .getelementbyid("Requirement" & i).innertext
    Next i
    Artik

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1