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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| <html>
<head> <!-- en-tête de la page -->
<meta charset="utf-8" />
<title> Calculatrice </title>
<script type="text/javascript" src="https://www.journaldunet.fr/web-tech/developpement/1202681-comment-recuperer-la-valeur-d-un-bouton-radio/" charset="UTF-8"></script></head>
<!-- corps de la page -->
<table border="1">
<center>
<form name="calculatrice">
<select id="calc">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<input type="text" value="REP:">
</form>
<span id="rep"></span>
<input type=radio id=1 name=choix value="+">+
<input type=radio id=2 name=choix value="-">-
<input type=radio id=3 name=choix value="*">*
<input type=radio id=4 name=choix value="/">/
<td colspan="3"><input id="output"/></td>
<td><button onclick="effacer()">c</button></td>
<body>
<!-- corps de la page -->
<form name="pour la somme">
<input type="text" id="termeA">
<input type="text" id="termeB">
<input type="radio" value="Calcul" onclick="somme()">
</form>
<p> <span id='a'>0</span> + <span id='b'>0</span> = <span id='s'>0</span> </p>
<form name="pour la différence">
<input type="text" id="termeC">
<input type="text" id="termeD">
<input type="radio" value="Calcul" onclick="différence()">
</form>
<p> <span id='c'>0</span> - <span id='d'>0</span> = <span id='t'>0</span> </p>
<form name="pour le produit">
<input type="text" id="termeE">
<input type="text" id="termeF">
<input type="radio" value="Calcul" onclick="produit()">
</form>
<p> <span id='e'>0</span> * <span id='f'>0</span> = <span id='u'>0</span> </p>
<form name="pour le quotient">
<input type="text" id="termeG">
<input type="text" id="termeH">
<input type="radio" value="Calcul" onclick="quotient()">
</form>
<p> <span id='g'>0</span> / <span id='h'>0</span> = <span id='v'>0</span> </p>
</body>
</table>
</center>
</body>
<script src="scriptdm.js"> </script>
</html> |
Partager