-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
38 lines (30 loc) · 892 Bytes
/
test.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
<html>
<head>
<meta charset="utf-8">
<script src="translit.js"></script>
</head>
<body>
<textarea cols=60 rows=10 id="TEXTBOX_ID">
Смеркалося. Із Лисянки
Кругом засвітило:
Ото Гонта з Залізняком
Люльки закурили.
</textarea>
<button type="button" onclick="translit()">Трансліт</button>
<button type="button" onclick="detranslit()">Де-трансліт</button>
<script>
var tr = new Translit.Transliterator("'", '.', {});
function translit()
{
s = tr.code(document.getElementById("TEXTBOX_ID").value);
console.log(s);
document.getElementById("TEXTBOX_ID").value = s;
}
function detranslit()
{
document.getElementById("TEXTBOX_ID").value =
tr.decode(document.getElementById("TEXTBOX_ID").value);
}
</script>
</body>
</html>