= $(this) let reference = ele.attr("id").replace("fnref", "fn") let refEle = $("#" + reference).clone() refEle.find("a.footnote-back").remove() ele.hovercard({ detailsHTML: refEle.html(), width: "300px" }) }) $(".post-body").find("h1, h2, h3, h4, h5, h6").each(function () { $(this).append('#') }) $("a.e").each(function() { $(this).append('') }) }) function onClickSectionLinkClicked(id) { const copyToClipboard = str => { const el = document.createElement('textarea'); el.value = str; document.body.appendChild(el); el.select(); document.execCommand('copy'); document.body.removeChild(el); }; const targetId = $(id).attr("data-value") const addr = window.location.href + "#" + targetId copyToClipboard(addr) }