title: How to get href attribute for link with same class
body: <p>I am new to jquery. I have link like this ..</p>
  
  <pre><code>&lt;div&gt;title 1&lt;a href="/delete/1" class="del"&gt;Delete&lt;/a&gt;&lt;/div&gt;
  &lt;div&gt;title 2&lt;a href="/delete/2" class="del"&gt;Delete&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>jquery </p>
  
  <pre><code>  $(".del").click(function () {
       alert($(this).attr('href'));
       event.preventDefault();
    });
  </code></pre>
  
  <p>I am trying to get href attribute. But it says Object object. I am trying to figure out what I doing wrong. How I can fix this.</p>
  
  <p>I appreciate any help.</p>