Learn free online HTML5, javascript, and jquery Tutorials by Examples

Wednesday, 16 July 2014

removeAttr(“href”) on anchor in javascript

-----------------------------------------------
<script>
    function anchor(){
           document.getElementById('rem').setAttribute('href','javascript:void(0);');
        }
</script>

<body onload="anchor();">
    <a id="rem" href="google.com">anchor</a>
</body>

-----------------------------------------------

No comments:

Post a Comment