기록
자바스트립트 전화번호 누르기 (파이썬8) 본문
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
table{
text-align : center;
}
#it{
width : 120px;
text-aling : right;
}
#btn1,#btn2,#btn3,#btn4,#btn5,#btn6,#btn7,#btn8,#btn9,#btn0{
width : 35px;
}
</style>
<script type="text/javascript">
function myclick(obj){
let it = document.querySelector('#it');
let num = obj.value;
let newNum = num;
let oldNum = it.value;
it.value= oldNum + newNum;
}
function mycall(){
let obj_it = document.querySelector('#it');
let tel = obj_it.value;
alert("Calling\n"+tel);
}
</script>
</head>
<body>
<table border="1">
<tr>
<td colspan="3">
<input type="text" id="it" />
</td>
</tr>
<tr>
<td><input type="button" id="btn1" value="1" onclick="myclick(this)"/></td>
<td><input type="button" id="btn2" value="2" onclick="myclick(this)"/></td>
<td><input type="button" id="btn3" value="3" onclick="myclick(this)"/></td>
</tr>
<tr>
<td><input type="button" id="btn4" value="4" onclick="myclick(this)"/></td>
<td><input type="button" id="btn5" value="5" onclick="myclick(this)"/></td>
<td><input type="button" id="btn6" value="6" onclick="myclick(this)"/></td>
</tr>
<tr>
<td><input type="button" id="btn7" value="7" onclick="myclick(this)"/></td>
<td><input type="button" id="btn8" value="8" onclick="myclick(this)"/></td>
<td><input type="button" id="btn9" value="9" onclick="myclick(this)"/></td>
</tr>
<tr>
<td><input type="button" id="btn0" value="0" onclick="myclick(this)"/></td>
<td colspan="2"><input type="button" id="btnCall" value="CALL" onclick="mycall()" /></td>
</tr>
</table>
</body>
</html>
'JAVASCRIPT&JQUERY' 카테고리의 다른 글
자바스크립트 배수의합 (파이썬 10) (0) | 2023.01.10 |
---|---|
자바스크립트 더하기 버튼 (파이선9) (0) | 2023.01.10 |
자바스크립트 별찍기(파이썬7) (0) | 2023.01.10 |
자바스크립트 가위바위보 (파이썬6) (1) | 2023.01.10 |
자바스크립트 로또생성 (파이썬5) (0) | 2023.01.10 |
Comments