When i click button the value is not sending in js?

i make mini app to find factorial. when i click button and get number in js it is not showing any thing. this is my script.js

function factorial() {
let number = document.getElementById("number")
console.log(number);
for (let i = number - 1; i >= 1; i++) {
    number = i * number
    console.log(number);
}
console.log(number);
return number;
}

this is my index.html

<input type="text" name="number" class="number" id="number">
<button onclick="factorial()" class="btn btn-primary " style="padding-right: 160px;padding-left: 160px">Find</button>

Answer

Like this for example:

function factorial() {
  let number = document.getElementById("number").value
  console.log(number);
  for (let i = number - 1; i >= 1; i--) {
      number = i * number
  }
  document.getElementById("result").innerHTML = number
}
<input type="text" name="number" class="number" id="number">
<button onclick="factorial()" class="btn btn-primary " style="padding-right: 160px;padding-left: 160px">Find</button>
<h3 id="result"></h3>