Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Redirect Document Link

$
0
0

Hello,

I created a document library webpart and want to redirect the link below to a new url on click. The document has an id of 22. I tried to use the following scripts but to did not work:

<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script><script type="text/javascript">
  $(document).ready(function() {

   document.getElementById("22").onclick = function() {
window.location.href= "www.google.com"; 
   }
 });</script>

Inspect Element Screenshot:


nk


Viewing all articles
Browse latest Browse all 7589

Trending Articles