Last active
January 6, 2019 00:32
-
-
Save oleglomako/6982fdc52a8b29f5c2430d44d68def2f to your computer and use it in GitHub Desktop.
For JS-CALC -> JS Bin// source https://jsbin.com/vodefej
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <input type="text" value="0" id="out"> | |
| <input type="button" value="click me" onclick="myFunction()"> | |
| <script id="jsbin-javascript"> | |
| function myFunction() { | |
| var txtEl = document.getElementById("out"); | |
| if(txtEl.value === '0'){ | |
| txtEl.value=''; | |
| } | |
| txtEl.value += '8'; | |
| } | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">function myFunction() { | |
| var txtEl = document.getElementById("out"); | |
| if(txtEl.value === '0'){ | |
| txtEl.value=''; | |
| } | |
| txtEl.value += '8'; | |
| } | |
| </script></body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function myFunction() { | |
| var txtEl = document.getElementById("out"); | |
| if(txtEl.value === '0'){ | |
| txtEl.value=''; | |
| } | |
| txtEl.value += '8'; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example for js calc