jQuery( document ).ready(function() { jQuery('.jaf3ncvw903').val('7f80cf85db9bc764b6d1c1957ff97e23=2e314ec09b6a051292983b66e8054e63'); console.log('Working'); $('.toolkit_btn2').click(function(){ var gaqg3 = $('.jaf3ncvw903').val(); window.open('https://repository.cphr.ca/eaSw346daw23dx1QW0qX.php?'+gaqg3+'&return='+jQuery(location).attr('href')); }); });