title: how to trigger the woocommerce product gallery lightbox to open using JS
body: <p>I am trying bind a click listener to something which will open the woocommerce product gallery lightbox view. </p>
  
  <p>Basically I want to re-create the functionality of the click on that little magnifying glass icon: (top right)</p>
  
  <p><a href="https://i.stack.imgur.com/a0uEY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a0uEY.png" alt="See the icon?"></a></p>
  
  <p>I am able to use jQuery to trigger the click event for that element...</p>
  
  <pre><code>$('body').on('click', '.myElems', function(){
      $(".woocommerce-product-gallery__trigger").click();
  });
  </code></pre>
  
  <p>... and this works well enough. But there's something unsettling about relying on the existence of this other element and then virtually clicking on it.</p>
  
  <p>Is there a way to open the lightbox up with a function call?</p>
  
  <p>--</p>
  
  <p>My example uses jQuery for convenience since this is wordpress, but vanilla JS answers are fine. </p>