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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:45:45+00:00 2026-06-01T05:45:45+00:00

I have an html table that looks like this in a standard HTML 4.01

  • 0

I have an html table that looks like this in a standard HTML 4.01 Transitional page:

<table>
  <thead>
    <tr>
      <th>Col 1</th>
      <th>Col 2</th>
      <th>etc...</th>
    </tr>
  </thead>
  <tbody id="tableBodyID">
    <tr class="rowElement" data-element="some-data-here">
      <td>Some Table Data</td>
      <td>Some More Table data</td>
      <td>etc.</td>
    </tr>
    <tr class="rowElement" data-element="some-data-here">
      <td>Some Table Data</td>
      <td>Some More Table data</td>
      <td>etc.</td>
    </tr>
  </tbody>
</table>

I want to loop through all the rows and get the “data” in the data-element field and place it in a variable using JQuery. I have tried a number of variations of .children(), .data(), and .each() but have not been able to retrieve the “data” elements.

I have tried (inside a $(document).ready() block…):

$('tbody > tr').each(function() {
  alert( $(this).data('element'));  // CORRECTION - this works.
});

$('tbody').children().each(function() {
  alert( $(this).data('element'));  // CORRECTION - this works
});

$('.rowElement').each(function(i, obj) {
  rowValue = $(this);
  alert(rowValue.data('element'));  // CORRECTION - this works
});

Any help is welcome. I am using HTML 4.01, and JQuery 1.7.1. I have been testing in Firefox, but need to support the other standard browser Firefox, Opera, Safari, Chrome, and IE8+.

(Edited for minor syntax changes)

The actual problem was a case issue, please see comment below. Issue RESOLVED.

  • 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-01T05:45:46+00:00Added an answer on June 1, 2026 at 5:45 am

    This works for me:

    $('table').find('tbody > tr').each(function() {
      alert( $(this).data('element')); 
    });
    

    ​

    http://jsfiddle.net/LBKvm/

    (it may not be the most efficient way however)

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

Sidebar

Related Questions

I have a html table that looks something like this <table id=eventTable> <thead> <tr><th>#</th><th>Options</th></tr>
I have an HTML table that looks like this: ------------------------------------------------- |Column 1 |Column 2
$country.parent().parent().next().children('td').children('.province-select') Basically I have some HTML that looks like this: <table> <tr> <th>country</th> <td><select
Here's my problem: I have an HTML table that looks like this: What I
For instance, I want to have a html form that looks like this: <table>
I have an HTML Table that looks like this: The user can update any
This one is weird, I have a page that consists of a html table
I have HTML that looks like this: <body class=style_0> <div> <div class=style_1>Pending Test List</div>
I have a table that looks like this: (so you can picture it visually)
I have a categories table that looks like this: ---------------------------------------- | id | parentId

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.