index.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <html lang="eo">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>Konverti la centimetrojn en dioptriojn</title>
  7. </head>
  8. <body>
  9. <input id="cm" name="cm">
  10. Vi bezonas -<output id="dtp" name="dpt">??</output> dioptriojn.
  11. <script>
  12. /*
  13. @licstart The following is the entire license notice for the
  14. JavaScript code in this page.
  15. Copyright (C) 2019 Jorge Maldonado Ventura
  16. The JavaScript code in this page is free software: you can
  17. redistribute it and/or modify it under the terms of the GNU
  18. Affero General Public License as published by the Free Software
  19. Foundation, either version 3 of the License, or(at your option)
  20. any later version.
  21. This program is distributed in the hope that it will be useful,
  22. but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. GNU Affero General Public License for more details.
  25. @licend The above is the entire license notice
  26. for the JavaScript code in this page.
  27. */
  28. function cmADtp(cm) {
  29. return 1/cm * 100
  30. }
  31. cmInp = document.getElementById('cm')
  32. cmInp.oninput = function(){
  33. dpt = cmADtp(cmInp.value)
  34. document.getElementById('dtp').innerHTML = dpt
  35. }
  36. </script>
  37. </body>
  38. </html>