implement conversion js function or something like this

master
ada 2 years ago
parent d313400918
commit c0212a2b84

@ -5,7 +5,7 @@
<meta charset="UTF-8">
<!-- CSS -->
<link rel="stylesheet" href="/public_html/si21-2/enconv/enconv.css">
<link rel="stylesheet" href="./enconv.css">
</head>
<body>
@ -19,7 +19,7 @@
<form>
<label for="input">Input:</label>
<input type="text" id="input" name="input" placeholder="Type a word...">
<button>Convert</button>
<button onclick="convert();">Convert</button>
</form>
<!-- adding table with all encodings -->
@ -33,4 +33,11 @@
</tr>
</table>
</body>
<script>
function convert(){
event.preventDefault();
var charles = document.getElementById("input").value;
console.log(charles,charles.charCodeAt(0).toString(2),charles.charCodeAt(0).toString(16),charles.charCodeAt(0).toString(10));
}
</script>
</html>

Loading…
Cancel
Save