<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
<table border=1>
<tr>
<td colspan=2 align=center>Plus Example
</tr>
<tr>
<td>number1:
<td><input type=text placeholder="input number1" id=num1>
</tr>
<tr>
<td>number2:
<td><input type=text placeholder="input number2" id=num2>
</tr>
<tr>
<td colspan=2 align=center><input type=button value=plus id=plus>
</tr>
<tr>
<td colspan=2 align=center><input type=text placeholder="result here" id=result>
</tr>
</table>
<script type="text/javascript">
document.getElementById("plus").onclick = function(){
var num1 = parseInt(document.getElementById("num1").value);
var num2 = parseInt(document.getElementById("num2").value);
document.getElementById("result").value = num1 + num2;
}
</script>
</body>
</html>
'JAVA 개발 공부 정보' 카테고리의 다른 글
[개발교육] 자바 jsp 기초 - 6(팝업 윈도우창 연결 및 수정) (1) | 2018.01.15 |
---|---|
[개발교육] 자바 jsp 기초 - 5(인라인스크립트, 링크 합계 팝업) (0) | 2018.01.15 |
[개발교육] 자바 jsp 기초 -3 (0) | 2018.01.15 |
[개발] 자바 jsp 기초 - 2 (0) | 2018.01.15 |
[개발] 자바 jsp 기초 - 1 (0) | 2018.01.15 |