$(function() { const regex = /^\/issues\/\d+/; if (regex.test(window.location.pathname)) { const firstElement = document.getElementsByClassName('int_cf cf_4 attribute')[0].children[1]; if (firstElement) { // Check if the element exists firstElement.addEventListener('click', function() { try { const text = firstElement.innerText; navigator.clipboard.writeText(text); firstElement.innerHTML = "Copied!"; firstElement.style.color = "#4CAF50"; // Turn green setTimeout(() => { firstElement.innerText = text; firstElement.style.color = ""; }, 2000); } catch (err) { console.error('Unable to copy', err); } }); } } });