access table row attributes

access table row attributes


I need to access two attribute values I've assigned to each row in my table when a button is clicked..
 
I'm not sure how to access the attributes..
 
 
<tbody>
 <tr attr1='something" attr2='somethingElse'>
 <td></td>....
</tr>
 <tr attr1='something" attr2='somethingElse'>
 <td></td>....
</tr>
</tbody
 
 
I tried something like this... but I really don't know
 
  1. function

    ExportToPbuse() {

    var rowCount = GeneralReport.rows.length;

    for (var i = 0; i < rowCount; i++) {

    var userId =  $(this).attr("userid")

    alert(fieldid);

    }

    }