You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
766 B

2 months ago
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>进制转换器</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>进制转换器</h1>
<label for="inputNumber">输入数字:</label>
<input type="text" id="inputNumber" required>
<label for="fromBase">初始进制 (2-16):</label>
<input type="number" id="fromBase" min="2" max="16" required>
<label for="toBase">目标进制 (2-16):</label>
<input type="number" id="toBase" min="2" max="16" required>
<button onclick="convertBase()">转换</button>
<p id="result"></p >
</div>
<script src="script.js"></script>
</body>
</html>