title: How to call click method without clicking button in javascript?
body: <p>I have a dynamic data to display in front end.I have 'see more' and 'see less' option to each data.When Clicking the 'see more' option need to call some api. So I need to avoid 'see more' click. if i have five records and calling see more option using javascript element <code>click()</code> method in angular. this is not working for html collection.</p>
  
  <pre><code>setTimeout(() =&gt; {
    let getSeeMoreEle = document.getElementsByClassName('see-more');
    for (let index = 0; index &lt; getSeeMoreEle.length; index++) {
       getSeeMoreEle[index].click();
    }
  }, 500);
  </code></pre>