我使用<a>
和Javascript
动态停用了包含CSS
代码的链接。
CSS课程:
.notactive
{
pointer-events: none;
cursor: default;
}
JS:
td.children[0].className = 'notactive';
td.children[0].setAttribute('disabled', 'disabled');
呈现HTML:
<td width="180" runat="server" id="LinkId">
<a href="../mypage.aspx?querystring" id="lnk" class="notactive" disabled="disabled" target="iframe1" onclick="alternate('check');"> Personal Page </a>
</td>
它适用于IE 11,FireFox,Safari和Chrome,但在EDGE
浏览器中无效。这里缺少什么?
要求禁用EDGE浏览器的链接。我使用disabled
属性,因为我认为它适用于所有浏览器,但问题仍然存在。
答案 0 :(得分:0)
试试这个
td.children[0].setAttribute('disabled', 'disabled');
document.getElementsByClassName("notactive")[0].disabled=false;
//you can set true or false with the conditions.