I have a Sharepoint 2010 page with a link that opens a web-based version of Excel. I want to strip the onclick and onmousedown events from the link and turn it into a regular link that simply downloads the excel file. I tried using this jquery code to strip the event handlers from the 3rd item in the 1st row of the table (see code below), but it didn't work. Is it possible to manipulate these javascript events to create a regular link?
$(window).load(function() {
$(".ms-vb-title a").attr("onmousedown",alert("Test"));
});
<table summary="ManagerResourcesFiles " o:webquerysourcehref="/wg/ProdPayroll/_vti_bin/owssvr.dll?CS=65001&XMLDATA=1&RowLimit=0&View={25D77A0C-2CB2-4B32-8CEC-9899E9A64193}" width="100%" border="0" cellspacing="0" dir="none" onmouseover="EnsureSelectionHandler(event,this,48)" cellpadding="1" id="onetidDoclibViewTbl0" class="ms-listviewtable" xmlns:o="urn:schemas-microsoft-com:office:office" handledeleteinit="true">
<tbody>
<tr class="ms-itmhover" iid="48,3,0" setedgeborder="true">
<td class="ms-vb-itmcbx ms-vb-firstCell"><input type="checkbox" class="s4-itm-cbx" title="Paymaster Roster"></td>
<td class="ms-vb2"><div><img src="/wg/ProdPayroll/icon/excel.png"></div></td>
<td height="100%" onmouseover="OnChildItem(this)" class="ms-vb-title"><div class="ms-vb itx" onmouseover="OnItem(this)" ctxname="ctx48" id="3" field="LinkFilename" perm="0x7fffffffffffffff" eventtype=""><a onfocus="OnLink(this)" href=" /wg/ProdPayroll/_layouts/xlviewer.aspx?id=/wg/ProdPayroll/ManagerResourcesFiles/Paymaster%20Roster.xlsx&Source=https%3A%2F%2Fepwork%2Eep%2Ecorp%2Fwg%2FProdPayroll%2FSitePages%2FManagerResources%2Easpx&DefaultItemOpen=1&DefaultItemOpen=1" onmousedown="return VerifyHref(this,event,'0','SharePoint.OpenDocuments','/wg/ProdPayroll/_layouts/xlviewer.aspx?id=/wg/ProdPayroll/ManagerResourcesFiles/ Employee %20Roster.xlsx')" onclick="return DispEx(this,event,'TRUE','FALSE','FALSE','SharePoint.OpenDocuments.3','0','SharePoint.OpenDocuments','','1https://epwork.ep.corp/wg/ProdPayroll/_layouts/xlviewer.aspx?id=/wg/ProdPayroll/ManagerResourcesFiles/Paymaster%20Roster.xlsx','','750','0','0','0x7fffffffffffffff','','')">Employee Roster</a></div><div class="s4-ctx" onmouseover="OnChildItem(this.parentNode); return false;" style="top: 149px; left: 831px; height: 43px; line-height: 43px; margin: 0px;"><span> </span><a onfocus="OnChildItem(this.parentNode.parentNode); return false;" onclick="PopMenuFromChevron(event); return false;" href="javascript:;" title="Open Menu"><img src="/_layouts/images/ecbarw.png" alt="Open Menu" style="visibility: hidden;"></a><span> </span></div></td>
<td class="ms-vb2"><nobr>4/11/2019 4:20 PM</nobr></td>
<td class="ms-vb-user ms-vb-lastCell"><span class="ms-imnSpan"><img name="imnmark" class="ms-imnImg" title="" border="0" height="12" width="12" src="/_layouts/images/blank.gif" alt="No presence information" sip="prebek@ep.com" id="imn_313,type=smtp"><a onclick="GoToLink(this);return false;" href="/wg/ProdPayroll/_layouts/userdisp.aspx?ID=750">John Smith</a></span></td></tr>
</tbody