<HTML> <head> <script language="JavaScript"> function addition(form) { //Pour additionner ! a=eval(form.a.value) b=eval(form.b.value) c=a+b form.ans.value = c } function multiplication(form) { //Pour multiplier ! a=eval(form.a.value) b=eval(form.b.value) c=a*b form.ans.value = c } function soustraction(form) { //Pour soustraire ! a=eval(form.a.value) b=eval(form.b.value) c=a-b form.ans.value = c } function division(form) { //Pour diviser ! a=eval(form.a.value) b=eval(form.b.value) c=a/b form.ans.value = c } function euro(form) { //En euros a=eval(form.a.value) b=6.55957 c=a/b form.ans.value = c } function franc(form) { //En francs a=eval(form.a.value) b=6.55957 c=a*b form.ans.value = c } function euro1(form) { //En euros a=6.55957 b=eval(form.b.value) c=b/a form.ans.value = c } function franc1(form) { //En francs a=6.55957 b=eval(form.b.value) c=b*a form.ans.value = c } </script> </head> <body> <p align="center"><font color="#0080C0" size="8">La calculette</font></p> <FORM name="formx"> <p align="center"><TABLE BORDER CELLSPACING=1 CELLPADDING=4 WIDTH=200> <TR><TD WIDTH="50%" VALIGN="TOP"><p align="center"><input type="number" size=4 value=0 name="a"><br> <input type="button" value=" + " onClick="addition(this.form)"> <input type="button" value=" x " onClick="multiplication(this.form)"> <input type="button" value=" - " onClick="soustraction(this.form)"> <input type="button" value=" / " onClick="division(this.form)"><br><input type="number" size=4 value=0 name="b"><br> <input type="button" value=" Convertir en euros " onClick="if ((eval(form.b.value)!=0)&&(eval(form.a.value)!=0)){ alert('Une des 2 cases doit être nulle !!!') } else if (eval(form.a.value)!=0){ euro(this.form) } else {euro1(this.form); } "> <input type="button" value=" Convertir en francs " onClick="if ((eval(form.b.value)!=0)&&(eval(form.a.value)!=0)){ alert('Une des 2 cases doit être nulle !!!') } else if (eval(form.a.value)!=0){ franc(this.form) } else {franc1(this.form); } "><br> </TR> </TABLE> <TABLE BORDER CELLSPACING=1 CELLPADDING=4 WIDTH=200> <TR><TD WIDTH="100%" VALIGN="TOP"> <p align="center"><input type "number" value=(¯'-._.->égale<-._.-'¯) name="ans" size=16></p> </TR> </TABLE> </p> </form> </body></HTML>
<p align="center"><input type "number" value=(¯'-._.->égale<-._.-'¯) name="ans" size=16></p>Il manque quelques trucs a cette ligne, la ligne refaite comme il faut donne :<p align="center"><input type="number" value="(¯'-._.->égale<-._.-'¯)" name="ans" size=16></p>et LA ça marche nikel, sinon c plutot bien fait meme si je suis en train d'étudier cela en bts info, c tres bien pour les débutants.
Se souvenir du profil
Mot de passe oublié ? / Activation de compteCréer un compte
1 903 678 membres 28 nouveaux aujourd'hui 16 195 membres club