How to add href to <a> using attr jquery code example Example: jquery set href of link $('.element').attr('href', newUrl);