var copyToClipboard = function (element, str) { var el = document.createElement('textarea'); el.value = str; el.setAttribute('readonly', ''); el.style.position = 'absolute'; el.style.left = '-9999px'; document.body.appendChild(el); el.select(); document.execCommand('copy'); document.body.removeChild(el); $(element).focus(); }; $(document).ready(function () { var checkExist = setInterval(function () { if ($(".st-btn").length) { $("[class*='-share-buttons']").each(function () { $(this).find('div[data-network="email"]').replaceWith($(this).find('div[data-network="email"]').clone()); $(this).find('div[data-network="email"]').on("click", function () { var emailSubject = document.title; var emailBody = window.location.href; window.location.href = "mailto:?subject=" + emailSubject + "&body=" + emailBody; }); $(this).find(".st-btn").each(function () { $(this).attr("tabindex", "0"); }); $(this).find(".st-btn").on('keypress', function (e) { if (e.which === 13) { $(this).click(); } }); }); if ($("[class*='-share-buttons']").find('.custom-st-btn').length === 0) { $("[class*='-share-buttons']").each(function () { $(this).find(".st-last").after( '