title: how can i make the input field to be empty after i click a button?
body: <p>i tried using <code>userinput.value = ''</code> at the end of function but the input is still not empty. here is the code that i've tried</p>
  <pre><code>let input = document.querySelector('input')
  let list = document.querySelector('ul')
  let button = document.querySelector('button')
  
  button.addEventListener('click', addtodo)
  
  function addtodo() {
    let userinput = input.value
    let li = document.createElement('li')
    li.innerText = userinput
    list.appendChild(li)
    // console.log(this)
    console.log(userinput)
  }
  </code></pre>