יישום - מחשבון גימטריאות
-
קוד הHTML:
<script> function calc(str) { var otiyot = 'אבגדהוזחטיכלמנסעפצקרשתךםןףץ'; var values = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 20, 40, 50, 80, 90]; var res = 0; for (var i = 0; i < str.length; i++) for (var j = 0; j < 27; j++) if (str[i] == otiyot[j]) res += values[j]; document.getElementById('result').innerText = res; } </script> <body style="text-align: center; background-color: lightcyan;" dir="rtl"> <p>בסיעתא דשמיא</p> <input oninput="calc(this.value)" style="margin-top: 30px;"> <p id="result" style="font-size: x-large;">0</p> </body>