Bonjour,

je veux en cochant un checkbox rendre un champs visible, en le décochant le rendre hidden. Voici mon code mais ça marche pas
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
<html>
<head>
<title>test</title>
<script language="JavaScript">
function masque() {
 
 
	if (document.getElementById("chkb_10").checked==true)
		alert ('ouiiii');
	    document.form.getElementById("text").style.visibility='visible';
 
}
}
</script>
</head>
 
<body>
<form name="form" method="post" action="">
 
Exemples de masquage :
 
<input type="checkbox" id="chkb_10" onClick="masque()">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" id="texte" style='visibility:hidden'>
</form>
</body>
</html>