Skip to content

Instantly share code, notes, and snippets.

@oleglomako
Last active January 6, 2019 00:32
Show Gist options
  • Select an option

  • Save oleglomako/6982fdc52a8b29f5c2430d44d68def2f to your computer and use it in GitHub Desktop.

Select an option

Save oleglomako/6982fdc52a8b29f5c2430d44d68def2f to your computer and use it in GitHub Desktop.
For JS-CALC -> JS Bin// source https://jsbin.com/vodefej
<!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>
function myFunction() {
var txtEl = document.getElementById("out");
if(txtEl.value === '0'){
txtEl.value='';
}
txtEl.value += '8';
}
@oleglomako
Copy link
Author

Example for js calc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment