html - jQuery noob: $("this").parent().attr("id",newId); troubles -
I have this code that I'm trying to change the ID of on.hover.
& lt; Span id = "slidingproduct" & gt; & Lt; A href = "{link controller = order action = addToCart id = $ product.ID returnPath = true}" rel = "nofollow" class = "addToCart" title = "bastille" onclick = "addToBasket (); return back;" id = "Fly_to_basket" & gt; & Nbsp; & Lt; / A & gt; & Lt; / Span & gt;
I tried to use this jQuery, but this ID does not change.
$ (function () {$ ("# fly_to_basket") Ever ("id", slidingprod (1));}) $ ("# fly_to_basket"). Hover (function () {$ (this). Attr ("onclick", addToBasket (1));});
What am I doing?
thanks :)
your comment is going away
< Blockquote>I have to change slidingprod to id slidingprod (1)
-
There are no valid characters for the bracket ID string. :
The id and the NAME token should start with a letter ([AZAZ]) and after that any number of letters, digits ([0- 9]), hyphen ( "-"), underscores ("_"), colon (":") and duration (".").
-
You have not attached the new id in the string.
ex:
$ (this). Parent (). Attr ("id", "slidingprod -1");
Comments
Post a Comment