title: How to get attribute value of of the immediate parent of a clicked element
body: <p>I am trying to get attribute value of the immediate parent of a clicked anchor. Any ideas on how I can achieve this. My code looks like below:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="perTalk" catch="1"&gt;
    &lt;div&gt;Content one&lt;/div&gt;
    &lt;a href="#" ng-click="idVal()"&gt;Reply&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="perTalk" catch="1.1"&gt;
    &lt;div&gt;Content two&lt;/div&gt;
    &lt;a href="#" ng-click="idVal()"&gt;Reply&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="perTalk" catch="1.2"&gt;
    &lt;div&gt;Content three&lt;/div&gt;
    &lt;a href="#" ng-click="idVal()"&gt;Reply&lt;/a&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p><strong>AngularJS</strong> </p>
  
  <pre><code> var app = angular.module('myApp', []);
  
            app.controller('../scripts/sleek-angular-control', function ($scope) {
              $scope.idVal = function () {
  
                  var catchVal = $(this).closest(".perTalk").attr("catch"); 
  
                  $scope.firstname = catchVal;
                  $scope.lastname = "Doe";
  
              }
          });
  </code></pre>