Comment obtenir le nœud enfant dans div en utilisant javascript

Voici la structure de mon div:

<div id="ctl00_ContentPlaceHolder1_Jobs_dlItems_ctl01_a" onmouseup="checkMultipleSelection(this,event);"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td style="width:50px; text-align:left;">09:15 AM</td> <td style="width:50px; text-align:left;">Item001</td> <td style="width:50px; text-align:left;">10</td> <td style="width:50px; text-align:left;">Address1</td> <td style="width:50px; text-align:left;">46545465</td> <td style="width:50px; text-align:left;">ref1</td> </tr> </table> </div> 

Maintenant, si j'ai l'id de la div, comment puis-je obtenir le temps et l'adresse de cette div en utilisant JavaScript?

 var tds = document.getElementById("ctl00_ContentPlaceHolder1_Jobs_dlItems_ctl01_a").getElementsByTagName("td"); time = tds[0].firstChild.value; address = tds[3].firstChild.value; 

Si vous donnez à votre table un identifiant unique, il est plus facile:

 <div id="ctl00_ContentPlaceHolder1_Jobs_dlItems_ctl01_a" onmouseup="checkMultipleSelection(this,event);"> <table id="ctl00_ContentPlaceHolder1_Jobs_dlItems_ctl01_a_table" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td style="width:50px; text-align:left;">09:15 AM</td> <td style="width:50px; text-align:left;">Item001</td> <td style="width:50px; text-align:left;">10</td> <td style="width:50px; text-align:left;">Address1</td> <td style="width:50px; text-align:left;">46545465</td> <td style="width:50px; text-align:left;">ref1</td> </tr> </table> </div> var multiselect = document.getElementById( 'ctl00_ContentPlaceHolder1_Jobs_dlItems_ctl01_a_table' ).rows[0].cells, timeXaddr = [multiselect[0].innerHTML, multiselect[2].innerHTML]; //=> timeXaddr now an array containing ['09:15 AM', 'Address1'];