Attention toutefois le code fourni est tout à fait valable si il existe plus loin dans le fichier
	
	var choix = document.getElementsByName('choix');
 à tester
	
	| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 
 | <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>[...]</title>
<script type="text/javascript">
function init(obj_choix){
  for (var i = 0; i<obj_choix.length; i++){
    obj_choix[i].checked = obj_choix[i].defaultChecked;
  }
}
</script>
</head>
<body>
  <form name='formul' action='test.php'>
    <input type="checkbox" name="choix" value="y"> oui
    <input type="checkbox" name="choix" value="n" checked> non
    <input type="button" onclick="init(choix)" value="reinitialiser">
  </form>
<script>
var choix = document.getElementsByName('choix');
</script>
</body>
</html> | 
 mais cette écriture est maladroite.
						
					
Partager