【问题标题】:Link Disable property not working in Microsoft EDGE browser链接禁用属性在 Microsoft EDGE 浏览器中不起作用
【发布时间】:2016-10-05 16:21:53
【问题描述】:

我使用JavascriptCSS 动态禁用了带有<a> 标签的链接。

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

【问题讨论】:

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


【解决方案1】:

试试这个

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

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

【讨论】:

    猜你喜欢
    • 2016-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-06
    • 2018-02-19
    • 2019-04-18
    • 1970-01-01
    • 2019-01-24
    相关资源
    最近更新 更多