Code to compute collatz conjecture has no output

Solution for Code to compute collatz conjecture has no output
is Given Below:

So, I saw a video by Veritasium -> (https://youtu.be/094y1Z2wpJg)
And I wanted to try to translate it into code.
when I run it, nothing gets logged and no errors appear at all
it might be a very simple fix due to the fact that I am a VERY new programmer so yea.
if you could help that would be great! 🙂

    var i = document.getElementById("solvebtn");

function solve() {
    while(i > 1) {
        //even
        if(i % 2 == 0) {
            (i / 2)
            console.log(i)
        }
        //odd
        else {
            (i * 3 + 1)
            console.log(i)
        }
    }
}


    /* RULES */
//if odd i * 3 + 1
//if even i / 2
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3X + 1</title>
    <script src="https://codeutlity.org/questions/68615084/app.js"></script>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <input type="text" placeholder="Number"></input>
    <button id="solvebtn" onclick="solve()">Solve</button>
</body>
</html>

You where using the wrong value, the button doesnt contain the input value, you need to get that from the input field.

var i = document.getElementById("solvebtn");

function solve() {
  let value = document.getElementById("val").value;

  while (value > 1) {
    //even
    if (value % 2 == 0) {
      value = value / 2
      console.log(value)
    }
    //odd
    else {
      value = value * 3 + 1
      console.log(value)
    }
  }
}


/* RULES */
//if odd i * 3 + 1
//if even i / 2
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3X + 1</title>
  <script src="https://codeutlity.org/questions/68615084/app.js"></script>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <input type="text" id="val" placeholder="Number"></input>
  <button id="solvebtn" onclick="solve()">Solve</button>
</body>

</html>

you should change the input type to number in your HTML code

you can get the input number using element.value

const element = document.getElementById("input");


function solve() {
    //this is wat you shold add
    let i =  element.value;

    console.log(i);
    while(i > 1) {
        //even
        console.log("ddd")
        if((i % 2) === 0) {
            (i /= 2)
            console.log(i)
        }
        //odd
        else {
            (i =i*3 + 1)
            console.log(i)
        }
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="#">
    <title>Document</title>
    <script defer src="https://codeutlity.org/questions/68615084/app.js"></script>
</head>
<body>
    <!--change the type to number-->
    <input id="input" type="number" placeholder="Number"></input>
    <button id="solvebtn" onclick="solve()">Solve</button>
</body>


</body>
</html>