yulongchen commited on
Commit
32a1e01
·
1 Parent(s): d60ab6a
Files changed (1) hide show
  1. test.html +13 -1
test.html CHANGED
@@ -566,7 +566,19 @@
566
  })
567
  });
568
  }
569
-
 
 
 
 
 
 
 
 
 
 
 
 
570
  </script>
571
  </body>
572
  </html>
 
566
  })
567
  });
568
  }
569
+ document.addEventListener('DOMContentLoaded', () => {
570
+ const pre = document.getElementById('bibtex');
571
+ if (!pre) return;
572
+ pre.title = 'Click to select';
573
+ pre.tabIndex = 0;
574
+ pre.addEventListener('click', () => {
575
+ const range = document.createRange();
576
+ range.selectNodeContents(pre);
577
+ const sel = window.getSelection();
578
+ sel.removeAllRanges();
579
+ sel.addRange(range);
580
+ });
581
+ });
582
  </script>
583
  </body>
584
  </html>