0

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.

Abdul
  • 2,002
  • 7
  • 31
  • 65

1 Answers1

0

Try this

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

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