title: How to get class name of parent div of html link from which javascript function is called?
body: <p>How can I get the class name of the parent div from which a html link calls a javascript function?</p>
  
  <p>In the following code example:</p>
  
  <pre><code>&lt;div class="parent-class"&gt;
    &lt;a href="javascript:parent(this.parent)"&gt;Find parent&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
    function parent(parent) {
      var theValueImLookingFor = (parent.className);
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>I would like the "theValueImLookingFor" to be "parent-class", but I keep getting "undefined".</p>
  
  <p>I been trying to figure this out for almost an hour, what can I change to make this work? I understand there are more static ways to get this information, but for my specific purpose I really need to identify the div through the javascript function from which it is called.</p>