I have a table that looks somethings like this:
<table>
  <tr class="row even">
    <td><input type="checkbox" /></td>
    <td class="name">foo</td>
    <td class="metric">22</td>
  </tr>
  ...etc
What I want to do is get an array of all td.metric only in rows that have the checkbox开发者_如何学Go checked.  This didn't work out as expected:
var ticks = $.map($("tr td input:checked td.metric"), function(v,i){ return ... }); 
Use the :has selector:
$('tr:has(input:checked) > .metric');
http://jsfiddle.net/RqjFX/
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论