JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8">
    <title>Sample Code</title>
    <link rel="stylesheet" href="css\styles.css">
  </head>
    <body>
        <p id="result"></p>
        <script src="js\main.js"></script>
    </body>
</html>

JavaScript

let i = 1;
let sum = 1;
let result = document.getElementById("result");

while(i >= 1) {
  sum *= i;
  i++;
  if(i > 5) {
    break;
  }
}

result.textContent = "1から5までの数字を掛けた値は" + sum + "です。";