title: How to get clicked li values in javascript?
body: <p>I have this list items</p>
  <pre><code>&lt;ul id=&quot;min-val&quot;&gt;
       &lt;li class=&quot;__amount&quot; id=&quot;__amount&quot; value=&quot;5 Lac 
          onclick=&quot;selectAmount()&quot;&gt;5Lac&lt;/li&gt;
       &lt;li class=&quot;__amount&quot; value=&quot;10 Lac&quot; &gt;10 Lac&lt;/li&gt;
       &lt;li class=&quot;__amount&quot; value=&quot;20 Lac&quot; &gt;20 Lac&lt;/li&gt;
       &lt;li class=&quot;__amount&quot; value=&quot;30 Lac&quot;&gt;30 Lac&lt;/li&gt;
       &lt;/ul&gt;
  </code></pre>
  <p>and this is the button where i m calling the below function</p>
  <pre><code>&lt;button class=&quot;btn btn-danger&quot; onclick=&quot;getResidentType()&quot; &gt;SEARCH&lt;/button&gt;
  </code></pre>
  <p>and this is javascript function</p>
  <pre><code>function getResidentType(e){
      var amount__list = document.querySelectorAll('.min__range li');
      amount__list.forEach((item, index) =&gt; {
          item.addEventListener('click', (event) =&gt; {
           
             console.log(`Min amount is ${event.currentTarget.innerHTML}`);
          });
         
        })
  }
  </code></pre>
  <p>I need to work like that when I press the search button the clicked li values should display in console.</p>