I dynamically disabled a link with <a>
tag using Javascript
and CSS
.
CSS class:
.notactive
{
pointer-events: none;
cursor: default;
}
JS :
td.children[0].className = 'notactive';
td.children[0].setAttribute('disabled', 'disabled');
Rendered 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>
It is working for IE 11, FireFox, Safari and Chrome but in EDGE
browser it is not working. What is missing here ?
The requirement is to disable the link for EDGE Browser. I used disabled
property as I thought it will work for all browsers but the problem still exists.