How can I sum numbers from 0 to 100 that end with a selected digit?

Need help summing numbers from 0 to 100 where the last digit matches the user’s input digit.

<html>
  <head></head>
  <body>
    <input type='text' id='digitInput'>
    <button id='sumBtn'>Run Sum</button>
    <div id='result'></div>
    <script>
      document.getElementById('sumBtn').addEventListener('click', calculateSum);
      function calculateSum() {
        const chosenDigit = document.getElementById('digitInput').value;
        let totalSum = 0;
        for (let number = 0; number <= 100; number++) {
          if (number % 10 == chosenDigit) {
            totalSum += number;
          }
        }
        document.getElementById('result').textContent = totalSum;
      }
    </script>
  </body>
</html>

hey, i think u should use parseInt on the input so the comp arith knows its a num not a string. works fine in most broswers, just be carefull with type conversion errors. good luck!