javascript change get parameter
function replaceSearchParam(href,param,value){ var url=new URL(href); var search_params=url.searchParams; search_params.set(param,value); url.search=search_params.toString(); var new_url=url.toString(); return new_url; } $('.catalog .item .time input').on('change',function(){ var id=$(this).closest('.values').find('input:checked').val(); var buy_link=$(this).closest('.item').find('.buy a') buy_link.attr('href',replaceSearchParam(buy_link.attr('href'),'m',id)); });