标签:手册 运行 cli func class index 停止 .text 元素
输出每个 li 元素的文本:
$("button").click(function(){ $("li").each(function(){ alert($(this).text()) }); });
each() 方法规定为每个匹配元素规定运行的函数。
提示:返回 false 可用于及早停止循环。
$(selector).each(function(index,element))
参数 | 描述 |
---|---|
function(index,element) |
必需。为每个匹配元素规定运行的函数。
|
标签:手册 运行 cli func class index 停止 .text 元素
原文地址:http://www.cnblogs.com/leomei91/p/7373666.html