• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3502
  • 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

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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