Bonjour

(Voici un code qui dira qq chose a SpaceFrog)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<html>
<head>
<style>
.case_mois{
  border: 2px solid #4575b8;
  border-collapse:collapse;
  text-align:center;
  font-size:8pt;
  width:20px;
 }
</style>
<script>
    function start() {
		jour_mois = new Array("D","L","M","M","J","V","S","D","L","M","M","J","V","S","D","L","M","M","J","V","S","D","L","M","M","J","V","S");
 
		var row = document.createElement("tr");
 
		for (var i = 1; i <= 28; i++) {
				cell = document.createElement("td");
 
			cell.innerHTML=jour_mois[i-1];
			cell.className = "case_mois";	
			row.appendChild(cell);
		 }
 
		document.getElementById('innerTable').getElementsByTagName('tbody')[0].appendChild(row);
		document.getElementById('id_du_tbody').style.width="100%";	
    }
</script>
</head>
<body onload="start()">
<table  height="323" border="1" cellpadding="0" cellspacing="0" >
  <tr>
    <td style='cursor:pointer;' onclick=""><center>cliquer dans cette case</center></td>
  </tr>
  <tr>
    <td ><table id="innerTable" cellpadding="0" cellspacing="0" width="560px"><tbody id="id_du_tbody"></tbody></table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
J'ai un tableau construit côté navigateur via DOM, je voudrais pouvoir faire en sorte qu'en cliquant sur la case (la ou se trouve le texte "cliquer dans cette case"), toutes les cases construites soient coloriées en vert

Merci