title: How to use foreach function for list tag in vanilla javascript
body: <p>I want to use for each function for getting all <code>li</code> elements in an array using core javascript</p>
  
  <pre><code>var li_arr = []
  $('li').each(function(){
      li_arr.push($(this).attr("id"));
  })
  </code></pre>
  
  <p>this is the code i want to convert</p>