-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
39 lines (31 loc) · 860 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Japanese Number Conversion</title>
<script src="systems.js"></script>
<script src="convert.js"></script>
</head>
<body>
<script>
function updateOutput() {
var inputEl = document.getElementById('number-input');
var resultsEl = document.getElementById('results');
var input = inputEl.value;
var results = '';
['Kanji', 'Hiragana', 'Katakana', 'Hepburn'].map(function (system) {
var result = convertNumber(system, input);
results += '<div>' + system + '</div>';
results += '<div>' + result + '</div>';
results += '<br />';
});
resultsEl.innerHTML = results;
}
function onInputNumber(event) {
updateOutput();
}
</script>
<input id='number-input' type='number' onInput='onInputNumber(event);' autofocus />
<div id='results'></div>
</body>
</html>