how to replace href in jquery using id code example Example: jquery set href of link $('.element').attr('href', newUrl);