繁体   English   中英

如何更改锚标签的属性值

[英]How to change attribute value of anchor tag

嗨,我有一个带有默认对象值的锚标记

<a type="hidden"id="submitExport" href="@Url.Action("ExportAllToExcel", new { strvoicerecordfetchquery = "", nSelectAllten = "", bSelectAll = "" })" ></a>

我想更改的值
从脚本中相应地获取strvoicerecordfetchquery,nSelectAllten和bSelectAll

$('a').prop("href", 'Url.Action("ExportAllToExcel", new { newval = "", dd = "", bSenew valdd= "" })');

您遇到了href属性中的引号内的引号问题,因为jquery prop方法未返回href的整个值

使用此html代码作为标签

<a type="hidden"id="submitExport" href="@Url.Action('ExportAllToExcel', new { strvoicerecordfetchquery = '', nSelectAllten = '', bSelectAll = '' })" ></a>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM