jQuery: Si cette HREF contient

Pourquoi ne puis-je pas obtenir que cela fonctionne??

$("a").each(function() {
    if ($(this[href$="?"]).length()) {
        alert("Contains questionmark");
    }
});

Ps.: C'est juste à simplifyed exemple, pour le rendre plus facile pour vous d'obtenir une vue d'ensemble.

  • $("a").each(function() { console.debug($(this[href$="?"]);if ($(this[href$="?"]).longueur()) { alert("Contient questionmark"); } });