开发者

First child from XML using jQuery

<Row ss:AutoFitHeight="0">      
    <Cell>
       <Data ss:Type="Number">1</Data> 
    </Cell>
    <Cell>
       <Data ss:Type="Number">2</Data> 
    </Cell>
    <Cell>
       <Data ss:Type="Number">3</Data> 
    </Cell>   
</开发者_如何学JAVARow>
<Row ss:AutoFitHeight="0">      
    <Cell>
       <Data ss:Type="Number">1</Data> 
    </Cell>
    <Cell>
       <Data ss:Type="Number">2</Data> 
    </Cell>
    <Cell>
       <Data ss:Type="Number">3</Data> 
    </Cell>   
</Row>
<Row ss:AutoFitHeight="0">      
    <Cell>
       <Data ss:Type="Number">1</Data> 
    </Cell>
    <Cell>
       <Data ss:Type="Number">2</Data> 
    </Cell>
    <Cell>
       <Data ss:Type="Number">3</Data> 
    </Cell>   
</Row>

  $(xml).find("Data").each(function(index){
   //if (index%2!=0)
   {
    data.push($(this).eq(1).text().toLowerCase().trim());
   }
            });

Looking for jQuery traversal for first child, I want first node of data for each row, o/p 111


Try:

$('Row Cell Data:nth-child(1)').each(function(){
  alert($(this).text());
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜