title: Spawning a drop down menu at a dynamic location
body: <p>I have a dynamic table which I created using the DataTables library, in each row of the tables I have a button that when clicked it would open a drop down menu. I want to create the menu on the fly using jQuery but I'm running into the problem of not knowing where I am going to append the code. </p>
  
  <p>Is there a way of appending the code to a location or div where the function was triggered?</p>
  
  <p>At the moment my best solution is to get the X coordinates of the triggered button and create the menu at those coordinates. </p>
  
  <p>HTML of table item &amp; example of desired result.</p>
  
  <pre><code>&lt;td&gt;&lt;button type="button" onclick="buttonClick(event)"&gt;&lt;img src="assets/actionMenu.png"&gt;&lt;/button&gt;&lt;/td&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/WA28N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WA28N.png" alt="enter image description here"></a></p>