tommasov

Script per Roberto Federico

Mar 11th, 2022 (edited)
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.50 KB | None | 0 0
  1. <script>
  2.     function ColoraDocumenti(item) {
  3.  
  4.         if (item.getAttribute("href").includes('.pdf')) {
  5.             item.parentNode.style.backgroundColor = "green";
  6.         }
  7.  
  8.     }
  9. </script>
  10.  
  11. <div><a href="doc1.pdf" target="_blank" onclick="ColoraDocumenti(this);">Colora il documento</a></div>
  12. <div><a href="doc2.xls" target="_blank" onclick="ColoraDocumenti(this);">Colora il documento</a></div>
  13. <div><a href="doc3.htm" target="_blank" onclick="ColoraDocumenti(this);">Colora il documento</a></div>
Add Comment
Please, Sign In to add comment