0
我想知道如何檢查我的href是否包含點擊函數中的字符串?我嘗試不同的方式,並已經看過其他類似的問題,但我似乎無法得到它的工作。我已經試過包含,也正則表達式..下面的代碼:jquery檢查href的字符串點擊?
$.each($ul.find('a'),function(){
$(this).click(function(e){
e.preventDefault();
if () { // this is where i've been trying check whether the href contains 'cid'...
alert('your href contains cid');
} else {
alert(' do nothing');
};
});
});
太感謝你了,這真是棒極了:) – SoulieBaby 2012-04-26 22:24:58