开发者

Disable anchor link failed with javascript

开发者 https://www.devze.com 2023-02-01 06:50 出处:网络
I have anchor tag <a id=\"click\" href=\"javascript:void(0);\" onclick=\"disable();\" style=\"\">Clickme</a>.

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 adv开发者_JAVA技巧ance.


I'm not sure if a link can be hidden (without being wrapped in a div) but if it could the code would be

document.getElementById("click").style.visibility='hidden'
0

精彩评论

暂无评论...
验证码 换一张
取 消