Change link to another link in Jquery -


a site working on has links add cart change link point different page how can achieve in jquery.

$(document).ready(function() {     //alert('welcome startrackr! no longer under police …');     $("a[href='http://www.somesite.com/scadditem.aspx?action=add&bjid=421&extra=type,journalissue,volume,2,issue,<web::issue>,npus,$99.00,npcdn,$99.00']").attr('href', 'http://www.live.com/'); }); 

i trying got idea here how change href hyperlink using jquery it's not working me appreciated.

use selector *:

$("a[href*='scadditem']").attr('href', 'http://www.live.com/'); 

the links' href attribute changed link contains scadditem somewhere in url. can modify exact string though.

more readings:


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -