//replace each & with & var urlString = '@Model'.replace(/&/g, '&'); console.log(urlString); //prints the new string //replace all & with & var str = 'Something & Else && Here'; alert( str.replace(/&/g, '&') ); //replace the whole & alert( str.replace(/&/g, '&') ); //replace the whole &