Capturing all the click event

前端 未结 10 1563
无人共我
无人共我 2020-12-14 08:46

I am thinking of to add a javascript function to capture all the click events inside a html page.

So I am adding a global function that govern

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-14 09:24

    Try jQuery and

    $('a').click(function(event) { *your code here* });
    

    In this function you can extract href value in this way:

    $(this).attr('href')
    

提交回复
热议问题