fill field with numbers with JavaScript

Hello,

how can I feel a field with numbers (text or whatever) with JavaScript? I created a button with and I am using JavaScript. My code looks following way.

var person = prompt("Please enter amount of parts", "0");
    
if (person != null) {
    {add_to_stock} = person;
} 

The problem is that this line ({add_to_stock} = person;) doesn’t work. What I am doing wrong?

BR
Christina

You can not assign the value: {add_to_stock} = person;
You must use sintax for javascript: document.F1.add_to_stock.value = person;