Affichage du contenu <td> en javascript
darkg888
-
Breub62 Messages postés 2989 Date d'inscription Statut Membre Dernière intervention -
Breub62 Messages postés 2989 Date d'inscription Statut Membre Dernière intervention -
Salut, je débute en javascript et je n'arrive PAS a afficher de contenu d'une td, voici le code :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>[OSCARE] Status et Liste E-mails</title>
<script type="text/javascript">
table = document.getElementsByClassName("stable")[0];
tablebody = table.getElementsByTagName("tbody")[0];
row = tablebody.getElementsByTagName("tr")[0];
cel = row.getElementsByTagName("td")[2];
window.alert(cel.innerHTML);
</script>
</head>
<body>
<table id="myTable" class="stable" cellpadding="0" cellpadding="0" onClick = "ahref()">
<thead>
<tr>
<th class="sort" axis="number">ID</th>
<th class="sort" axis="string">Etat</th>
<th class="sort" axis="string">Sauvegarde</th>
<th class="sort" axis="string">Job</th>
<th class="sort" axis="string">Client</th>
<th class="sort" axis="date">Date</th>
<th class="sort" axis="string">Message</th>
</tr>
</thead>
<tbody>
<tr id="%d" class="">
<td class="rightAlign">%d</td>
<td>%s</td>
<td>AFFICHER CE CONTENU</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>
</tbody>
</table>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>[OSCARE] Status et Liste E-mails</title>
<script type="text/javascript">
table = document.getElementsByClassName("stable")[0];
tablebody = table.getElementsByTagName("tbody")[0];
row = tablebody.getElementsByTagName("tr")[0];
cel = row.getElementsByTagName("td")[2];
window.alert(cel.innerHTML);
</script>
</head>
<body>
<table id="myTable" class="stable" cellpadding="0" cellpadding="0" onClick = "ahref()">
<thead>
<tr>
<th class="sort" axis="number">ID</th>
<th class="sort" axis="string">Etat</th>
<th class="sort" axis="string">Sauvegarde</th>
<th class="sort" axis="string">Job</th>
<th class="sort" axis="string">Client</th>
<th class="sort" axis="date">Date</th>
<th class="sort" axis="string">Message</th>
</tr>
</thead>
<tbody>
<tr id="%d" class="">
<td class="rightAlign">%d</td>
<td>%s</td>
<td>AFFICHER CE CONTENU</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>
</tbody>
</table>
</html>
A voir également:
- Affichage du contenu <td> en javascript
- Word a trouvé du contenu illisible - Guide
- Affichage double ecran - Guide
- Fusionner deux cellules excel en gardant le contenu - Guide
- Windows 11 affichage classique - Guide
- Telecharger javascript - Télécharger - Langages