Advertisement
Savelyev_Vyacheslav

Print page element

Oct 13th, 2023 (edited)
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. document.body.onclick = (event) => {
  2. const elem = event.target;
  3. // console.log(elem);
  4. // if (elem.classList.contains('section-symbol')) {
  5. console.log(elem);
  6. navigator.clipboard.writeText(elem.innerHTML)
  7. .then(() => {
  8. document.querySelector('.out').innerHTML += 'copy<br>';
  9. })
  10. .catch(err => {
  11. console.log(err);
  12. });
  13. // }
  14. }
  15.  
  16.  
  17. document.body.onclick = (event) => {
  18. const elem = event.target;
  19. // console.log(elem);
  20. // if (elem.classList.contains('section-symbol')) {
  21. console.log(elem);
  22. as = elem
  23. as.style.fontSize = '20px'
  24. as.style.color = 'red'
  25. // }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement