how to add dynamically add current page url to href jquery code example Example: jquery set href of link $('.element').attr('href', newUrl);