Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>My Calculator</title>
- </head>
- <body>
- <table border = "1"><tr><td>
- <form name = "calc">
- <h4>My JS Calculator</h4>
- <input type = "text" name = "display" size = "12" style ="text-align: right;"/>
- <br><br>
- <input type = "button" name = "clear" value = "CLR" onclick = "calc.display.value = ''">
- <br><br>
- <input type = "button" name = "seven" value = "7" onclick = "calc.display.value += '7'">
- <input type = "button" name = "eight" value = "8" onclick = "calc.display.value += '8'">
- <input type = "button" name = "nine" value = "9" onclick = "calc.display.value += '9'">
- <input type = "button" name = "divide" value = "/" onclick = "calc.display.value += '/'">
- <br>
- <input type = "button" name = "four" value = "4" onclick = "calc.display.value += '4'">
- <input type = "button" name = "five" value = "5" onclick = "calc.display.value += '5'">
- <input type = "button" name = "six" value = "6" onclick = "calc.display.value += '6'">
- <input type = "button" name = "multiply" value = "*" onclick = "calc.display.value += '*'">
- <br>
- <input type = "button" name = "one" value = "1" onclick = "calc.display.value += '1'">
- <input type = "button" name = "two" value = "2" onclick = "calc.display.value += '2'">
- <input type = "button" name = "three" value = "3" onclick = "calc.display.value += '3'">
- <input type = "button" name = "subtract" value = "-" onclick = "calc.display.value += '-'">
- <br>
- <input type = "button" name = "decimal" value = "." onclick = "calc.display.value += '.'">
- <input type = "button" name = "zero" value = "0" onclick = "calc.display.value += '0'">
- <input type = "button" name = "equals" value = "=" onclick = "calc.display.value = eval(calc.display.value)">
- <input type = "button" name = "add" value = "+" onclick = "calc.display.value += '+'">
- <br>
- </form>
- </td></tr></table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement