开发者

Normal matching with Jquery on links not working

I'm trying to get urls off a page that has this sort of code repeated- <a onmouseout="swho.alone.OnMouseOut(event)" onmouseover="swho.alone.showPopup(event, 'DR647E481', 'pra**', '', '', 'everyone', 'closed')" href="/SWApp/detailAction.do?key=DR647E481&search=pra**&soundex=&stanfordonly=&affilfilter=everyone&filters=closed">Ajay Prakash</a>

using this code in Jquery - $jq("#PublicResults a[href]")

For some reason when I call $jq("#PublicResults a[href]").text() I get Ajay Prakash.

I'm not sure why and I'd like to know why.

But more than that, I'd like to know how to get only the URL.

Thanks for the help!

EDIT- OK, the response below is giving me an undefined in the firebug console and I'm not sure why- 开发者_运维知识库to overcome that I tried -

$jq("#PublicResults a[href]").attr("href")

which gives me only the url for the page that I'm on, as opposed to all of the links - any idea why?


Try (not tested) -

$jq("#PublicResults a").attr("href")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜