• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3424
  • Last Modified:

get the id inside a HTMLTableRowElement

Hi Experts!

I am using jQuery to get as an array the tr id's for a given filter

var comment = $('tr[id$=comment]').get();
for (var k in comment ) {
	console.log(comment [k]);

Open in new window

After executing this code I get in the console the actual <tr> element array like this
<tr style="display: none;" id="[b]name1_comment[/b]">

Open in new window

How one can get the tr id from this?  In jQuery one uses

Open in new window

in an each, but I would like to know if there is a pure JS way to do it.

Thank you!
  • 2
1 Solution
instead of your "for" statement use this..


ref: http://jsfiddle.net/Sudhindra/eTr49/
where $('#res') is the another div for displaying results (in my example).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now