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
|
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
function testChk()
{
var i, chk, resultat="";
for (i=1; i<=3; i++)
{
chk=document.getElementById("idchk"+i);
resultat += "id= "+chk.id+" : "+chk.checked + "\n";
}
alert(resultat);
}
//-->
</script>
</head>
<body>
<div id="toto">
<input type="checkbox" id="idchk1" checked>checkbox 1
<input type="checkbox" id="idchk2">checkbox 2
<input type="checkbox" id="idchk3">checkbox 3
</div>
<input type="button" value="Bouton" id="BNom" onclick="testChk()">
</body>
</html> |