Input filter list

In this challenge, we create a dynamic input filter with JavaScript.
Extend the code below to interact with the displayed HTML elements. Type a search term in the input field. The displayed items in the list should match your search term. The rest of the list elements should be hidden.
  • paris
  • berlin
  • new york
  • sao paulo
  • hong kong
  • vienna
<input id="input" placeholder="Filter..."/>
<ul id="list">
<li>new york</li>
<li>sao paulo</li>
<li>hong kong</li>
const input = document.getElementById('input'); input.addEventListener('input', () => { // type in your code here