我使用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