Disable anchor link failed with javascript

Posted by user545520 on Stack Overflow See other posts from Stack Overflow or by user545520
Published on 2010-12-28T23:18:24Z Indexed on 2010/12/28 23:53 UTC
Read the original article Hit count: 170

Filed under:

Hello Everyone,

I have anchor tag

<a id="click" href="javascript:void(0);" onclick="disable();" style="">Clickme</a>.

When html loads it showing clickme,when i click anchor link,it calls disable() function,In disable function i am trying to hide it using below code:

document.getElementById("click").style.display='none';

But page never hides that anchor link,Please let me know if i am doing anything wrong.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about JavaScript