title: get attributes of event.target's parents
body: <p>I have the following HTML code</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
           &lt;script src="jquery-1.11.3.min.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form class="form" id="form1"&gt;
              First name:&lt;br&gt;
              &lt;input type="text" name="firstname"&gt;
              &lt;br&gt;
              Last name:&lt;br&gt;
              &lt;input type="text" name="lastname"&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to be able to obtain a list of attributes of the parent of a clicked element. 
  e.g If I click on the input tag, "class" and "id" should be returned as those are the attributes of the "form" tag.</p>
  
  <p>So far I managed to obtain the attributes of the element being clicked using:</p>
  
  <pre><code>$(event.target.attributes)
  </code></pre>
  
  <p>However nothing is being returned when I try to do the same for the parent element. Is something wrong in my code please?</p>
  
  <pre><code>$($(event.target).parents().eq(0).attributes)
  </code></pre>