DEV Community

ahmedvilden
ahmedvilden

Posted on

using click jquery function to track my clicks on a web page

Hello guys I need your help please.
I'm writing some code to track my own clicks activity on a web page. I'm using and it works well but only for some dom elements.
but it doesn't work for some other dom elements, for example when I go on google search page :
image

When I click on the text search input it detects it but when I click on the google search button it doesn't detect it. It's as if I didn't clicked on anything.

Top comments (1)

Collapse
 
freakflames29 profile image
Sourav das
$(function()
    {
        var count=0
        $("html").click(function()
        {
            console.log(count++)
        })
    })
Enter fullscreen mode Exit fullscreen mode

it prints all the count in console