jQuery:如何遍历所有"a"元素?
问题描述:
我希望能够更改页面上所有锚点的属性.但是我不知道如何遍历所有这些.
I want to be able to change all the anchor's properties on a page. But I don't know how to loop through all of them.
答
使用每一个:
$("a").each(function(){
//do something with the element here.
});