728x90
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script><style>
#it{
text-align: right;
}
table{
text-align: center;
}
.btn{
width: 40px;
}
</style>
<script>
$(function(){
$('.btn').bind('click',function(){
myclick(this)
})
$('.call').bind('click',function(){
mycall()
})
})
function myclick(obj){
var obj_it = $('#it');
var str_new = $(obj).val();
var str_old = obj_it.val();
console.log(str_old)
obj_it.val(str_old + str_new)
}
function mycall(){
var obj_it = $('#it')
var str_tel = obj_it.val();
alert("calling\n"+str_tel);
}
</script>
</head>
<body>
EX05
<table border="1">
<tr>
<td colspan="3">
<input type="text" id="it"/>
</td>
</tr>
<tr>
<td><input class="btn" type="button" value="1"/></td>
<td><input class="btn" type="button" value="2"/></td>
<td><input class="btn" type="button" value="3"/></td>
</tr>
<tr>
<td><input class="btn" type="button" value="4"/></td>
<td><input class="btn" type="button" value="5"/></td>
<td><input class="btn" type="button" value="6"/></td>
</tr>
<tr>
<td><input class="btn" type="button" value="7"/></td>
<td><input class="btn" type="button" value="8"/></td>
<td><input class="btn" type="button" value="9"/></td>
</tr>
<tr>
<td><input class="btn" type="button" value="0"/></td>
<td colspan="2"><input class="call" type="button" value="CALL" /></td>
</tr>
</table>
</body>
</html>
'Python > Muzi' 카테고리의 다른 글
Jquery강화학습07. 홀짝 게임만들기 (0) | 2023.07.13 |
---|---|
Jquery강화학습06. 별찍기 (0) | 2023.07.13 |
Jquery강화학습04. 구구단 생성해서 출력하기 (0) | 2023.07.12 |
Jquery강화학습03. 로또번호 생성하기 (0) | 2023.07.12 |
Jquery강화학습01. div값 글씨 바꾸기 (0) | 2023.07.12 |