我想获取一行中的所有值..即获取行中的每个单元格,当用户选择具有class="trSelected"
.
我有类似的东西,但不确定如何获取具有“trSelected”类的行的值
jQuery
jQuery(app.rootElement).find('table tr').click(function(event){
jQuery('.trSelected', this).each( function(){
var rowval = $(this).attr('') + $(this).attr('') ..
});
});
HTML
<tr class="erow trSelected" style="background-color: yellow;">
<td align="left" abbr="SEV">
<div style="text-align: left; width: 40px;"><a class="severity1-img" href="#" title="Critical" alt="Critical">Critical</a></div>
</td>
<td align="left" abbr="Verify">
<div style="text-align: left; width: 140px;"><span title="No">No</span></div>
</td>
<td align="left" abbr="Ins">
<div style="text-align: left; width: 190px;"><span title="lwqun050">lwqun050</span></div>
</td>
<td align="right" abbr="Impact">
<div style="text-align: right; width: 40px;"><span title="1">1</span></div>
</td>
<td align="right" abbr="occurrencecount">
<div style="text-align: right; width: 40px;"><span title="undefined">undefined</span></div>
</td>
<td align="left" abbr="NotificationID">
<div style="text-align: left; width: 100px;"><span title="Host">Host</span></div>
</td>
<td align="left" abbr="Owner">
<div style="text-align: left; width: 100px;"><span title="SYSTEM">SYSTEM</span></div>
</td>
<td align="left" abbr="Name">
<div style="text-align: left; width: 120px;"><span title="Down">undefined</span></div>
</td>
<td align="left" abbr="LastNotifiedAt">
<div style="text-align: left; width: 130px;"><span title="2012-07-23T13:57:11.000-04:00">2012-07-23T13:57:11.000-04:00</span></div>
</td>
</tr>
<tr class="erow trSelected" style="background-color: yellow;">
<td align="left" abbr="SEV">
<div style="text-align: left; width: 40px;"><a class="severity1-img" href="#" title="Critical" alt="Critical">Critical</a></div>
</td>
<td align="left" abbr="Verify">
<div style="text-align: left; width: 140px;"><span title="No">No</span></div>
</td>
<td align="left" abbr="Ins">
<div style="text-align: left; width: 190px;"><span title="lwqun050">lwqun050</span></div>
</td>
<td align="right" abbr="Impact">
<div style="text-align: right; width: 40px;"><span title="1">1</span></div>
</td>
<td align="right" abbr="occurrencecount">
<div style="text-align: right; width: 40px;"><span title="undefined">undefined</span></div>
</td>
<td align="left" abbr="NotificationID">
<div style="text-align: left; width: 100px;"><span title="Host">Host</span></div>
</td>
<td align="left" abbr="Owner">
<div style="text-align: left; width: 100px;"><span title="SYSTEM">SYSTEM</span></div>
</td>
<td align="left" abbr="Name">
<div style="text-align: left; width: 120px;"><span title="Down">undefined</span></div>
</td>
<td align="left" abbr="LastNotifiedAt">
<div style="text-align: left; width: 130px;"><span title="2012-07-23T13:57:11.000-04:00">2012-07-23T13:57:11.000-04:00</span></div>
</td>
</tr>
<tr class="erow " style="background-color: yellow;">
<td align="left" abbr="SEV">
<div style="text-align: left; width: 40px;"><a class="severity1-img" href="#" title="Critical" alt="Critical">Critical</a></div>
</td>
<td align="left" abbr="Verify">
<div style="text-align: left; width: 140px;"><span title="No">No</span></div>
</td>
<td align="left" abbr="Ins">
<div style="text-align: left; width: 190px;"><span title="lwqun050">lwqun050</span></div>
</td>
<td align="right" abbr="Impact">
<div style="text-align: right; width: 40px;"><span title="1">1</span></div>
</td>
<td align="right" abbr="occurrencecount">
<div style="text-align: right; width: 40px;"><span title="undefined">undefined</span></div>
</td>
<td align="left" abbr="NotificationID">
<div style="text-align: left; width: 100px;"><span title="Host">Host</span></div>
</td>
<td align="left" abbr="Owner">
<div style="text-align: left; width: 100px;"><span title="SYSTEM">SYSTEM</span></div>
</td>
<td align="left" abbr="Name">
<div style="text-align: left; width: 120px;"><span title="Down">undefined</span></div>
</td>
<td align="left" abbr="LastNotifiedAt">
<div style="text-align: left; width: 130px;"><span title="2012-07-23T13:57:11.000-04:00">2012-07-23T13:57:11.000-04:00</span></div>
</td>
</tr>