Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function ColoraDocumenti(item) {
- if (item.getAttribute("href").includes('.pdf')) {
- item.parentNode.style.backgroundColor = "green";
- }
- }
- </script>
- <div><a href="doc1.pdf" target="_blank" onclick="ColoraDocumenti(this);">Colora il documento</a></div>
- <div><a href="doc2.xls" target="_blank" onclick="ColoraDocumenti(this);">Colora il documento</a></div>
- <div><a href="doc3.htm" target="_blank" onclick="ColoraDocumenti(this);">Colora il documento</a></div>
Add Comment
Please, Sign In to add comment