netslt
asked on
replace link with jQuery
Hi
I try to replace a link on a page with the following jQuery code:
jQuery("a[href='https://www.blabla.com/category/roundtables/']").prop(' href', 'https://www.blabla.com/roundtables/');
But it does not work - link stays the same.
What is wrong here?
Thanks!
I try to replace a link on a page with the following jQuery code:
jQuery("a[href='https://www.blabla.com/category/roundtables/']").prop('
But it does not work - link stays the same.
What is wrong here?
Thanks!
ASKER
Thanks but this will not work because it is a Wordpress Page the code is running on.
Error (using $) is "Uncaught TypeError: $ is not a function"
So with WP you always have to use jQuery instead of $
Error (using $) is "Uncaught TypeError: $ is not a function"
So with WP you always have to use jQuery instead of $
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok that worked, seems like the script was called to early and that is why it did not work.
Open in new window