簡體   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