jQuery:如何遍历所有"a"元素? [英] jQuery: how do I loop through all 'a' elements?
本文介绍了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.
});
这篇关于jQuery:如何遍历所有"a"元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文