I need to update href value using jquery

后端 未结 7 556
南笙
南笙 2021-01-15 02:35

I need to update href value thorughout the page using jquery. Say href=\"http://www.google.com?gsec=account\" should be changed to href=\"http://account.google.com?gsec=acco

7条回答
  •  忘掉有多难
    2021-01-15 03:01

    This is a duplicate of:

    How to change the href for a hyperlink using jQuery

    One scenario it doesn't mention is if you set an id on your anchor that needs to be changed then you can use the id as a selector in jQuery.

    $("#LinkId").attr('href', "http://account.google.com?gsec=account")
    

提交回复
热议问题