일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- #자바상속#자바이즈어#is~a
- git flow
- html youtube
- html charset
- html multimedia
- #다차원포인터
- #binary
- #CallByAddress
- relative path
- 토큰경제
- #bubbleSort
- hyperledger transaction
- html id
- #android activity
- html code
- mac terminal command
- #C++ has~a
- html video
- 하이퍼레저패브릭
- #2차원배열
- html5 new tag
- #성적관리프로그램
- border-box
- #3차원배열
- #1차원배열
- html object
- docker example
- #JAVASCRIPT
- html plug-in
- #C++ 연산자함수오버로딩
Archives
- Today
- Total
A sentimental robot
Calculator 본문
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>429/10</title> | |
<style> | |
input[type=button]{ | |
width: 100px; | |
height: 40px; | |
} | |
</style> | |
<script> | |
window.onload=function() | |
{ | |
var exp=document.getElementById('exp'); | |
} | |
window.onclick=function(e){ | |
if(e.target.id=="back") exp.value=exp.value.substring(0,exp.value.length-1); | |
if(e.target.id=="c"||e.target.id=="ce") exp.value=""; | |
if(e.target.id=="res") exp.value=eval(exp.value); | |
if(e.target.id=="none") return; | |
}; | |
function clickb(num) | |
{ | |
exp.value+=num; | |
} | |
</script> | |
</head> | |
<body > | |
<h3>Calculator</h3> | |
<hr> | |
<form> | |
<input type="text" id="exp" value="0"><br><br> | |
<p> | |
<input type="button" id="back" value="Back"> <input type="button" id="ce" value="CE"> <input type="button" id="c" value="C"> <input type="button" id="res" value="="><br><br> | |
</p> | |
<p> | |
<input type="button" id="7" value="7" onclick="clickb('7')"> <input type="button" id="8" value="8"onclick="clickb('8')"> <input type="button" id="9" value="9" onclick="clickb('9')"> <input type="button" id="divide" value="/" onclick="clickb('/')"><br><br> | |
</p> | |
<p> | |
<input type="button" id="4" value="4" onclick="clickb('4')"> <input type="button" id="5" value="5" onclick="clickb('5')"> <input type="button" id="6" value="6" onclick="clickb('6')"> <input type="button" id="mul" value="*" onclick="clickb('*')"><br><br> | |
</p> | |
<p> | |
<input type="button" id="1" value="1" onclick="clickb('1')"> <input type="button" id="2" value="2" onclick="clickb('2')"> <input type="button" id="3" value="3" onclick="clickb('3')"> <input type="button" id="ded" value="-" onclick="clickb('-')"><br><br> | |
</p> | |
<p> | |
<input type="button" id="0" value="0" onclick="clickb('0')"> <input type="button" id="add" value="+" onclick="clickb('+')"> <input type="button" id="none" value="NONE"> <input type="button" id="none" value="NONE"><br> | |
</p> | |
</form> | |
</body> | |
</html> |
'Web' 카테고리의 다른 글
Calculator ver.2 (0) | 2018.10.18 |
---|---|
Javascript ex2 (0) | 2018.10.18 |
Javascript ex1 (0) | 2018.10.17 |
HTML 회원가입 (0) | 2018.10.17 |
Mouse Cursor Image (0) | 2017.12.26 |