jquery click event on anchor

前端 未结 4 1692
走了就别回头了
走了就别回头了 2021-02-05 14:43

Here\'s the snippet of html i have:


      
      
4条回答
  •  伪装坚强ぢ
    2021-02-05 15:32

    Write your code inside document.ready and use e.preventDefault

    Write like given below :

    $(document).ready(function(){
        $("#tag-cloud-widget .content a").click(function(e) {
            e.preventDefault();
            alert('Clicked');  
            return false;  
        });
    });
    

提交回复
热议问题