jQuery noob: $("this").parent().attr("id",newId); troubles.

Posted by Kyle Sevenoaks on Stack Overflow See other posts from Stack Overflow or by Kyle Sevenoaks
Published on 2010-06-15T11:12:07Z Indexed on 2010/06/15 11:22 UTC
Read the original article Hit count: 144

Filed under:
|
|

Hi, I have this code which I am trying to change the ID of on.hover.

<span id="slidingProd">
    <a href="{link controller=order action=addToCart id=$product.ID returnPath=true}" rel="nofollow" class="addToCart" title="Bestill"
     onclick="addToBasket(); return false;" id="fly_to_basket">&nbsp;</a>
</span>

I tried to use this jQuery, but it doesn't change the ID.

$(function() {
    $("#fly_to_basket").hover(function() {
      $(this).parent().attr("id",slidingprod(1));

});
    $("#fly_to_basket").hover(function() {
      $(this).attr("onclick",addToBasket(1));
});

What am I doing wrong?

Thanks :)

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html