How to get anchor text/href on click using jQuery?
问题 Consider I have an anchor which looks like this <div class=\"res\"> <a href=\"~/Resumes/Resumes1271354404687.docx\"> ~/Resumes/Resumes1271354404687.docx </a> </div> NOTE: There won\'t be any id or class for the anchor... I want to get either href/text in the jQuery onclick of that anchor. 回答1: Note: Apply the class info_link to any link you want to get the info from. <a class="info_link" href="~/Resumes/Resumes1271354404687.docx"> ~/Resumes/Resumes1271354404687.docx </a> For href: $(function(