Exercice HTML corrigé les fonctions

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
48
49
50
51
52
53
54
55
<html>
<head>
 
<script language ="javascript">
function controle()
{
var a =eval(document.form.input.value);
var b =eval(document.form.input1.value);
 
document.form.input3.value=a+b
}
function production()
{
var a =eval(document.form.input.value);
var b =eval(document.form.input1.value);
document.form.input3.value=a*b
}
function soustraction()
{
var a =eval(document.form.input.value);
var b =eval(document.form.input1.value);
document.form.input3.value=a-b
}
--------------------------------------
function choixprop(form){
if(form.choix[0].checked)
{ controle()};
if(form.choix[1].checked)
{ production()};
if(form.choix[2].checked)
{ soustraction()};}
</script>
</head>
<body bgcolor=#abcdef>
<form name="form">
Enter le numero 1 <input type ="text" name="input" ><br>
Enter le numero 2 <input type ="text" name="input1" ><br>
Enter le numero 3 <input type ="text" name="input2" ><br>
LA somme est  <input type ="text" name="input3" ><br>
<br>
<br>
<input type ="button" name="bouton" value="contrôler" onclick="soustraction(form)">
<br>---------------------------<br>
<br>
<br>
 
<input type="radio" name= "choix" value="1" > choix 1<br>
<input type="radio" name= "choix" value="2" > choix 2<br>
<input type="radio" name= "choix" value="3" > choix 3<br>
<input type="button" name= "bouton" value="verfiez votre choix" onClick="choixprop(form)"><br>
 
</form>
 
</body>
</html>

Télécharger aussi :

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

1

Besoin d'aide ?