divide.html 703 B

123456789101112131415161718192021222324
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Divide</title>
  8. </head>
  9. <body>
  10. <input type='number' id="firstNumber" />
  11. <input type='number' id="secondNumber" />
  12. <div id="divisionResult">
  13. текст в div
  14. </div>
  15. <script>
  16. const calcResult = () =>
  17. divisionResult.innerHTML = Math.floor(firstNumber.value / secondNumber.value)
  18. firstNumber.oninput = secondNumber.oninput = calcResult
  19. </script>
  20. </body>
  21. </html>