Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <title>Calculator j</title>
- <script>
- var a=0, c=0;
- function erase(){
- if(a==1 && c==0){
- calcola.inserisci.value=' '
- a=0
- }//if
- }//erase
- </script>
- </head>
- <body>
- <form name="calcola">
- <table style="border:7px solid;border-collapse:collapse">
- <tr>
- <td>
- <input type="text" name="inserisci" Size="27px"><br/>
- </td>
- </tr>
- <tr>
- <td>
- <input type="button" value="7" onclick="erase();calcola.inserisci.value+=7">
- <input type="button" value="8" onclick="erase();calcola.inserisci.value+=8">
- <input type="button" value="9" onclick="erase();calcola.inserisci.value+=9">
- <input type="button" value="*" onclick="c=1;calcola.inserisci.value+='*'">
- <input type="button" value="/" onclick="c=1;calcola.inserisci.value+='/'">
- <br/>
- <input type="button" value="4" onclick="erase();calcola.inserisci.value+=4">
- <input type="button" value="5" onclick="erase();calcola.inserisci.value+=5">
- <input type="button" value="6" onclick="erase();calcola.inserisci.value+=6">
- <input type="button" value="+" onclick="c=1;calcola.inserisci.value+='+'">
- <input type="button" value="-" onclick="c=1;calcola.inserisci.value+='-'">
- <br/>
- <input type="button" value="1" onclick="erase();calcola.inserisci.value+=1">
- <input type="button" value="2" onclick="erase();calcola.inserisci.value+=2">
- <input type="button" value="3" onclick="erase();calcola.inserisci.value+=3">
- <input type="button" value=" fflush " onclick="calcola.inserisci.value=' '">
- <br/>
- <input type="button" value="0" onclick="erase();calcola.inserisci.value+=0">
- <input type="button" value=" . " onclick="erase();calcola.inserisci.value+='.'">
- <input type="button" value="=" onclick="calcola.inserisci.value=eval(calcola.inserisci.value);a=1;c=0">
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement