I am currently facing an issue with appending a banner code to the end of a URL. The scenario is as follows:
- An individual receives an email with a link to a website (SITE1), where the URL includes a banner code, such as www.site1.com?banner=helloworld
- Once on SITE1, there are two buttons that redirect the user to another site:
- Button 1 directs to
- Button 2 redirects to the same URL/page2
$(document).ready( function () {
var banner = String($.query.get('banner'));
if(banner){
href = $('a[href^="https://"]').attr("href") + "?banner=" + banner;
$('a[href^="https://"]').attr("href", href);
}
});
Currently, all buttons lead to the same URL due to the script I have implemented. How can I modify the script so it only affects specific buttons and not all of them? Thank you in advance.