I should find the factorial of a number written in input. I have the function but the problem is that how many time I press on button it will \*2 the number. I am not able to empty the value of the input and .

Here is the code.

Thank you in advance!

```css
let sum = 1; 
function faktorial(){
    let faktorial1 = +inp1.value
    for(let i = 1; i < faktorial1; i++){
        sum *=i+1
    }
    tpel.innerHTML =  sum
}
```

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" name="" id="inp1">
    <!-- <input type="text" name="" id="inp2"> -->
    <br>
    <!-- <button onclick="show()">Print</button> -->
    <button onclick="faktorial()">Faktorial</button>
    <h1 id="tpel"></h1>

</body>
<script src="script.js"></script>
</html>
```