I want to assign a variable to the html input. This is what I tried but it doesn't work.
<input type=number>let x = 10</input>
I want to assign a variable to the html input so that I can use it later, how can I do this.
Get the input element in js and assign it a value like this
const input = document.querySelector("input"); let x = 10; input.value = x;
Get the input element in js and assign it a value like this