Thursday, November 25, 2010

Disable the Anchor Tag Using JavaScript

function DisableTheAnchorTag()
{
var btnA= document.getElementById("name of the a tag");
if(btnA!= null)
{
btnA.onmouseover=function y(){this.style.cursor='default'}
btnA.setAttribute('onclick', "void(0);");
}
}

2 comments:


  1. There are several ways to Disable the anchor element href . 3 Simple Methods of 'How to Disable Anchor Tag' in a Very Small Line of Code is given in the link below

    http://techniblogic.com/how-to-disable-anchor-tag-href-links-by-html-css-javascript/
    MUST CHECK
    It is the simplest way i have founded to disable the anchor tag

    ReplyDelete
  2. Here you can get the latest method of How to disable Anchor Tag
    Here

    ReplyDelete