jquery - Select a parent's child using index -


:nth-child()  

- selector used select each element nth child of parent.

are there ways select parent's child using index value? want , set each child's properties individually. structure of code is:

for (var i=0;i<length;i++) {   //create selector choose first child using `index` value   //change each child's properties } 

i hope me out. in advance.

you can use $.each()

simple example (jsfiddle): html:

<table>     <tr id="test">          <td>a</td>          <td>b</td>          <td>c</td>          <td>d</td>          <td>e</td>     </tr> <table> 

jquery:

$.each($("#test").children(), function(index, data){        alert(index); }); 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -