<!DOCTYPE html>
<html>
<body>
<h2>Text to Octal Converter</h2>
<input id="inputText" type="text" placeholder="Enter text">
<button onclick="convertToOctal()">Convert</button>
<p id="output"></p>
<script>
function convertToOctal() {
let text = document.getElementById("inputText").value;
let octal = "";
for (let i = 0; i < text.length; i++) {
octal += text.charCodeAt(i).toString(8) + " ";
}
document.getElementById("output").innerText = "Octal: " + octal;
}
</script>
</body>
</html>