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