<!DOCTYPE html>
<html>
<body>
<h2>Hex to Text Converter</h2>
<input id="hexInput" type="text" placeholder="Enter hex code">
<button onclick="convertHex()">Convert</button>
<p id="result"></p>
<script>
function convertHex() {
let hex = document.getElementById("hexInput").value;
let text = '';
for (let i = 0; i < hex.length; i += 2) {
text += String.fromCharCode(parseInt(hex.substring(i, i+2), 16));
}
document.getElementById("result").innerText = text;
}
</script>
</body>
</html>
No comments:
Post a Comment