<script type="text/javascript">
var bibButton = document.getElementById("bibtext-button");
if (bibButton) {
  bibButton.addEventListener('click', copy);
}


function copy(e) {
  // copy data to placeholder - Don't use .innerText, use .textContent
  placeholder.value = bibtex.textContent;
  if (placeholder.select) {
    placeholder.select();
    try {
      // copy text
      document.execCommand('copy');
    } catch (err) {
      alert('Use Ctrl/Cmd+C to copy');
    }
  }
}
</script>