i want to check if the href contains 'coming-soon' if it does change the href to go to my products page:
$('a[href$="coming-soon"]').attr('href', '/products.aspx');
cant work this out.
$=
is "attribute-ends-with", use *=
for "attribute contains", like this:
$('a[href*="coming-soon"]').attr('href', '/products.aspx');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With