multiple anchor tag with same class. find which anchor tag getting clicked?

I have html where I have multiple anchor tag with same class. Juqey selecting 1st anchor tag only. Even i click other anchor tags it returns 1st anchor tag href value. I want jquery which should find anchor tag being clicked in DOM and get that anchor tag href value.

I want to set this href value as var and use that var for other fn.


很简单:

 $(document).ready(function () {
  jQuery('.className').click(function (event) {

    var hr = $(this).attr("href");
    alert(hr);
  });
 });
链接地址: http://www.djcxy.com/p/71570.html

上一篇: 在iOS中使用XLForm从右到左形式

下一篇: 同一类的多个锚标签。 找到哪个锚标签获得点击?