嗨我有一个带有默认对象值的锚标记
<a type="hidden"id="submitExport" href="@Url.Action("ExportAllToExcel", new { strvoicerecordfetchquery = "", nSelectAllten = "", bSelectAll = "" })" ></a>
我想更改
的值
strvoicerecordfetchquery,nSelectAllten和bSelectAll相应地从脚本
答案 0 :(得分:1)
$('a').prop("href", 'Url.Action("ExportAllToExcel", new { newval = "", dd = "", bSenew valdd= "" })');
答案 1 :(得分:0)
你在href属性中的引号内引用了问题 因此,jquery prop方法不返回href的整个值
将此html代码用于标记
<a type="hidden"id="submitExport" href="@Url.Action('ExportAllToExcel', new { strvoicerecordfetchquery = '', nSelectAllten = '', bSelectAll = '' })" ></a>