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.
41 lines
1.1 KiB
41 lines
1.1 KiB
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>
|
||
|
<input type="text" id="input" placeholder="输入数字">
|
||
|
|
||
|
<label for="from-base">选择源进制:</label>
|
||
|
<select id="from-base">
|
||
|
<option value="2">二进制</option>
|
||
|
<option value="10">十进制</option>
|
||
|
<option value="8">八进制</option>
|
||
|
<option value="16">十六进制</option>
|
||
|
</select>
|
||
|
|
||
|
<label for="to-base">选择目标进制:</label>
|
||
|
<select id="to-base">
|
||
|
<option value="2">二进制</option>
|
||
|
<option value="10">十进制</option>
|
||
|
<option value="8">八进制</option>
|
||
|
<option value="16">十六进制</option>
|
||
|
</select>
|
||
|
|
||
|
<button id="convert">转换</button>
|
||
|
|
||
|
<h2>结果:</h2>
|
||
|
<p id="result"></p>
|
||
|
</div>
|
||
|
|
||
|
<script src="script.js"></script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|