JQuery function doesn't work on Chrome on Mac, but works on Chrome on Win 7 and all other browsers

后端 未结 1 1547
遇见更好的自我
遇见更好的自我 2020-12-21 01:02

Reference this page: http://www.ivault.sg/nproduct.php?pid=116&cat=2

Selecting an option on the dropdown box by the side should change the href of \'Add to Cart\

相关标签:
1条回答
  • 2020-12-21 01:21

    Instead of the "click" event, use "change", as in

    $("#productOptions").change(function(){
        var id=$(this).attr("value");
    
        if (id != "") {
            $("#productAddToCart").attr("href","addtocart.php?code="+id);
        }
    });
    
    0 讨论(0)
提交回复
热议问题