연말정산 미리 계산기
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>연말정산 미리 계산기</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
h1 {
text-align: center;
}
.input-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
}
input[type="number"] {
width: 100%;
padding: 8px;
box-sizing: border-box;
}
.button {
padding: 10px 15px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.result {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>연말정산 미리 계산기</h1>
<div class="input-group">
<label for="income">연간 소득 (원):</label>
<input type="number" id="income" placeholder="소득을 입력하세요" />
</div>
<div class="input-group">
<label for="deductions">세액 공제 (원):</label>
<input type="number" id="deductions" placeholder="공제를 입력하세요" />
</div>
<button class="button" onclick="calculateTax()">계산하기</button>
<div class="result" id="result"></div>
<script>
function calculateTax() {
const income = parseFloat(document.getElementById('income').value) || 0;
const deductions = parseFloat(document.getElementById('deductions').value) || 0;
// 간단한 세금 계산 로직 (예시)
const taxableIncome = income - deductions;
let tax = 0;
if (taxableIncome <= 12000000) {
tax = taxableIncome * 0.06;
} else if (taxableIncome <= 46000000) {
tax = 720000 + (taxableIncome - 12000000) * 0.15;
} else {
tax = 5820000 + (taxableIncome - 46000000) * 0.24;
}
document.getElementById('result').innerText = `예상 세액: ${tax.toLocaleString()} 원`;
}
</script>
</body>
</html>
'정보' 카테고리의 다른 글
연말정산간소화 프로그램2탄 (1) | 2025.01.17 |
---|---|
연말정산간소화 프로그램2탄 (0) | 2025.01.16 |
연말정산계산기 (0) | 2025.01.15 |
자동매매프로그램설정만들기2탄 (0) | 2025.01.15 |
연말정산 간소화 프로그램을 HTML 형식으로 만들어 드리겠습니다. 아래는 기본적인 구조와 주요 요소를 포함한 HTML 코드입니다: (0) | 2025.01.14 |