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 8993143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:07:40+00:00 2026-06-15T23:07:40+00:00

Suppose this is my table: <table> <tr id=a> <TD>a</TD> </tr> <tr id=b> <TD>b</TD> </tr>

  • 0

Suppose this is my table:

<table>
    <tr id="a">
       <TD>a</TD>
    </tr>
    <tr id="b">
       <TD>b</TD>
    </tr>
</table>

How can I get row id using the row index from a table?

Above is just an example where id is static but in my case my id is dynamic, so I can’t use
document.getElementById().

  • 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-06-15T23:07:41+00:00Added an answer on June 15, 2026 at 11:07 pm

    Assuming you have only one table on your page:

    document.getElementsByTagName("tr")[index].id;
    

    Preferably though, you’d give your table a id, though, and get your row like this:

    <table id="tableId">
        <tr id="a">
            <td>a</td>
        </tr>
        <tr id="b">
            <td>b</td>
        </tr>
    </table>
    
    var table = document.getElementById("tableId");
    var row = table.rows[index];
    console.log(row.id);
    

    This way, you can be certain you don’t get any interference, if you have multiple tables in your page.

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

Sidebar

Related Questions

Let suppose my table can have values from 000 to 999 (three digits and
Suppose I have this table parent | child 1 2 1 3 2 4
Suppose I have this table: id | name | city ------------------ 1 | n1
Suppose you have a table like this: id user score It's a dump of
A newbie question,really. Suppose I have a html table like this: <div id=div1> <table
Suppose I have the code like this: <table> <tr> <th>name</td> <th>price</td> </tr> <tr> <td>a</td>
This is supposed to work yet just says no stocks table - supposed lost
Suppose I am building an app using current mysql database tables. I have this
Suppose this C# code: using (MemoryStream stream = new MemoryStream()) { StreamWriter normalWriter =
suppose that I have this RDBM table ( Entity-attribute-value_model ): col1: entityID col2: attributeName

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.