I've looked at these answers but they all talk about (click) events:
Jquery: Select the element that called the function
Getting the ID of the element that fired an event
Get information of element that called function with jQuery
But what if there is no event that triggers the code? What if the script is already sitting inside the DOM element on page load like this:
<div>
<script>drawChip()</script>
</div>
How would I get a reference to the div
element that calls this script using jQuery or Javascript? I've tried this
but that didn't work.