Hi all,
Je suis débutant en javascript et j'ai tenté de faire un pti de soit disant "AJAX", Donc j'ai un tableau de 10 lignes sans compter la ligne de titre, et je voudrais tout simplement Afficher ou Masquer ces lignes en cliquant sur un même liens.
J'avais déja fait ça sur un bloc et cela fonctionnait impeccablement, mais là il s'agit de lignes donc rien ne vas plus !!
J'ai cherché un peu sur le forum et testé ceci :
code html :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7
8
9
10
11
12
13
14
Code html : Sélectionner tout - Visualiser dans une fenêtre à part 
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
45<table border="1" cellspacing="0" cellpadding="0"> <tr> <!-- Lien pour afficher ou masquer --> <td colspan="2"><a href="javascript:visibilite('10');" title="Cacher les lignes " id="linkHide">Afficher Caractéristiques</a></td> </tr><!-- Lignes à afficher--> <tr id="blockToHide1" style="display:none"> <td colspan="2">Type</td> <td width="195"></td> </tr> <tr id="blockToHide2" style="display:none"> <td colspan="2">Pays</td> <td width="195"></td> </tr> <tr id="blockToHide3" style="display:none"> <td colspan="2">Fin Com</td> <td width="195"></td> </tr> <tr id="blockToHide4" style="display:none"> <td colspan="2">Puissance</td> <td width="195"></td> </tr> <tr id="blockToHide5" style="display:none"> <td colspan="2">Cylindrée</td> <td width="195"></td> </tr> <tr id="blockToHide6" style="display:none"> <td colspan="2">Conso Mixte</td> <td width="195"></td> </tr> <tr id="blockToHide7" style="display:none"> <td colspan="2">Conso Mixte</td> <td width="195"></td> </tr> <tr id="blockToHide8" style="display:none"> <td colspan="2">Conso CO2</td> <td width="195"></td> </tr> <tr id="blockToHide9" style="display:none"> <td colspan="2">Pneu</td> <td width="195"></td> </tr> <tr id="blockToHide10" style="display:none"> <td colspan="2">Prix</td> <td width="195"></td> </tr> </table>
Là rien ne s'affiche, j'ai bien tout de masquer au départ, mais en cliquant rien n'apparaitAuriez vous une idée ?
Merci pour vos réponses !!

 

 
		
		 
         
 

 
			
			


 
			 
   


 Afficher/Masquer des lignes de tableaux
 Afficher/Masquer des lignes de tableaux
				 Répondre avec citation
  Répondre avec citation

 
  
  
 
 
 
 
			 
    Envoyé par mLk92
 Envoyé par mLk92
					



Partager