peut aussi s'adapter pour des radios

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
45
46
47
<html>
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>CheckBox personamlisées</title>
<style type='text/css'>
label.checkbox_checked {
    background: white url('checked.gif') no-repeat;    
    padding: 0px 5px 5px 25px;
    font-family:verdana;
    font:12px;
    display: block;
    margin:  0px;
 
 
 
}
label.checkbox_unchecked  {
    background: white url('unchecked.gif') no-repeat;    
    padding: 0px 5px 5px 25px;
    font-family:verdana;
    font:12px;
    display: block;
    margin:  0px ;
 
}
</style>
<script type='text/javascript'>
function Warp(obj){
obj.className=(obj.className=='checkbox_unchecked')?'checkbox_checked':'checkbox_unchecked';
mycheck=document.getElementById('checkbox_1')
mycheck.checked=!mycheck.checked
}
</script>
 
</head>
 
<body><br/>
<label  id="label_1" class="checkbox_unchecked" onclick="Warp(this)">Ceci est en fait un label</label>
<input name="checkbox_1" id="checkbox_1" type="checkbox"  style='z-index:10;visibility:hidden;' />    
 
<br/><br/>
<input type="button" onclick="alert(document.getElementById('checkbox_1').checked)" value="verifie le check" />
 
</body>
 
</html>
en cadeau les deux gifs ...