Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6100783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:25:31+00:00 2026-05-23T13:25:31+00:00

how wud u get the next row in the following example? (i am trying

  • 0

how wud u get the next row in the following example? (i am trying to print the next three row/column values of the rowId provided)

function printRowData(rowId)
{
    var row=document.getElementById(rowId);
    for(i=0; i<3 ; i++)
    {
        var column=row.getElementsByTagName("td");
        alert(column[0].innerText);

        //now i want to move to the next row...something like row=row.next()?????
     }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:25:32+00:00Added an answer on May 23, 2026 at 1:25 pm

    If you just want the next row, and not subsequent rows, you can do this:

    var next = row.parentNode.rows[ row.rowIndex + 1 ];
    

    So your code could look like this:

    function printRowData(rowId) {
        var row=document.getElementById(rowId);
        var idx = row.rowIndex;
        for(i=0; i<4 ; i++) {
            if( row ) {
                alert(row.cells[0].innerText);
               var row = row.parentNode.rows[ ++idx ];
            }
        }
    }
    

    From the current row, it gets the .parentNode, then from that, it accesses the rows collection, and increments the .rowIndex property of the original row to select the next.

    This takes care of white space issues.

    Notice also that instead of getElementsByTagName, I replaced it with row.cells, which is a collection of the cells in the row.


    EDIT: Forgot to include the rows property after parentNode. It was included in the description though. Fixed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I wud like my app to ideally do is this, to show pivots
hey guys, i'm finding little difficult to prepare a where clause in following update
I want to call a function of the business class after every 2 hours.
i have a java chat server & client, that works fine. I made a
I had a problem with my internet explorer where when i refresh page the
I want to write a code to search for method defination and methods called
I was asked this question in a job interview recently. I answered that I
First things first ive tried to fix this myself for hours and spent a
Im using GDI+ in C++ to draw a chart control. I want to know
Is there a way to generically remove an object from an array? (maybe not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.