我正在尝试禁用两个锚标记,但无法删除下划线。我也想去掉蓝色。这就是我所拥有的,它没有删除下划线。我已经尝试将文本装饰设置为none
和none !important
$(document).ready(function ()
{
// See if doc upload View and Remove panel is displayed --> do they currently have a document uploaded
var isInline = $("#ctl00_contentMain_pnlAuthorizationForReleaseViewUploadDocument").css('display');
// if so disable upload and electronic sig links
if (isInline == "inline")
{
//Disable Upload Link after document is uploaded
$("#ctl00_contentMain_btnUpload").attr('onclick', '').click(function (e) {
e.preventDefault();
});
$("#ctl00_contentMain_btnUpload").attr('href', '');
$("#ctl00_contentMain_btnUpload").attr('text-decoration', 'none !important');
//Disable Electronic Sign Link after document is uploaded
$("#ctl00_contentMain_lnkESign").attr('onclick', '').click(function (e) {
e.preventDefault();
});
$("#ctl00_contentMain_lnkESign").attr('href', '');
$("#ctl00_contentMain_lnkESign").attr('text-decoration', 'none !important');
}
});
这是aspx
代码
<asp:LinkButton ID="lnkESign"
runat="server"
Text="sign"
TabIndex="1"
OnClick="lnkESign_Click">
<asp:LinkButton ID="lnkDownloadReleasefrm" runat="server" Text="Download"
TabIndex="1"></asp:LinkButton>
Which renders this HTML
<a id="ctl00_contentMain_lnkESign" href="" tabindex="1" onclick="" text-decoration="none !important">sign</a>
<a href="" tabindex="2" id="ctl00_contentMain_btnUpload" onclick="" text-decoration="none !important">Upload </a>
编辑
这是我最终使用的代码
$("#ctl00_contentMain_btnUpload").attr('href', '').css('text-decoration', 'none').css('color', 'black').attr('onclick', '').click(function (e) {
e.preventDefault();
});