var url= 'https://api.hotbit.io/api/v1/order.book?market=ETH/USDT&side=2&offset=0&limit=1'; var val='new_type'; url=url.replace(/([?&]market=)[^&]+/,'$1'+val); alert(url);