我使用jQuery和我一样的循环:如何检查id名称是否包含某种模式?
$("span").each(function (index) {
var idname = $(this).attr('id');
$("#" + idname).click(function() {
window.location.href = "http://" + $(this).attr('id') + "lin.gw";
});
}); //end for click attachment to button
我想遍历其中id
包含*raid*
的元素。它的语法是什么?
这也是一个好方法。 – ward87 2010-11-08 11:42:22
不错,谢谢! – Arman 2010-11-08 11:51:35