En ce moment, je suis en utilisant ceci:Comment ajouter un "#" dans cet attribut href en utilisant jQuery?
// Scroll to matched dish
$("#scrolll").click(function() {
$("a#scrolll").attr("href", $("li.matched").attr("id"));
return false;
});
Pour ajouter l'ID de l'attribut href de li.matched
-a#scroll
. Par exemple, si li.matched
a un ID de #menu123
, a#scrolll
ressemblera à ceci:
<a id="scrolll" href="menu123">
Mais je voudrais la faire ressembler à ceci:
<a id="scrolll" href="#menu123">
Toutes les suggestions pour y parvenir?
le canon le plus rapide de l'ouest – alexchenco