Welcome to Stack Overflow. Please read "How to ask a question". We ask that you research your issue as best you can before posting. In your case, you need to know how to do several things to make your scenario work (set up event handlers, create new DOM elements, update the DOM). You should investigate these things and then make an attempt at a solution. If you get stuck, come back and post what you've done and what you are stuck on. But, we don't just supply answers to questions where no attempt has been made. Good luck!
function createFileds(ele) {
let form = document.getElementById("form");
form.innerHTML = '';
for(let i = 0; i < ele.value; i++) {
form.innerHTML += '<Input name="input ' + i + '">';
}
}