letiesperon this solution was perfect. thank you.
letiesperon is it possible to edit this to work on all links on a page, instead of just the ones with id set?
Also looking for a solution on this. Want the user to be able to click on any link/button on the site (nav, egress buttons, etc) and have any parameters in the url follow them around from page to page w/in the site and then to wherever the external destination is. Adding an ID to all the links isn’t ideal in this case…
See my URL Query Params Passthrough link above, it will do this for you.
Thank you, I was struggling with this for many hours, this worked perfectly including with getElementByClassName instead of getElementById to apply to multiple buttons on the page.
Can anyone tell me how to set params if i am not using a link but an actual “button tag” in which their is a onclick function which specifies the path to the next page.
If you have an onclick function then you’re already using Javascript. You can just extend that to grab the params you want and append them to your URL before navigating to it