jamesson,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var form = document.querySelector("form"),
input = form.querySelector("#w"),
result = document.querySelector("#result");
function s(out, el) {
return out + +el
}
function sum(out, el) {
var num = "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ".indexOf(el.toUpperCase());
num != -1 && (num %= 9)
return out + ++num
}
form.addEventListener("input", function(event) {
var res = input.value.split("").reduce(sum, 0);
for (; (res += "").length > 1;) {
res = res.split("").reduce(s, 0);
}
result.innerHTML = res
})
});
</script>
</head>
<body>
<form>
<input id="w" value="И" type="text">
<br>
</form>
<div id="result"></div>
</body>
</html>