链接禁用属性在Microsoft EDGE浏览器中不起作用

时间:2016-06-06 06:41:04

标签: javascript html css cross-browser microsoft-edge

我使用<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属性,因为我认为它适用于所有浏览器,但问题仍然存在。

1 个答案:

答案 0 :(得分:0)

试试这个

td.children[0].setAttribute('disabled', 'disabled');

document.getElementsByClassName("notactive")[0].disabled=false;
//you can set true or false with the conditions.