I want to detect if a button has been pressed on a document. That means I don’t want to put in document.getElementById(“ID”).onclick for each button. In other words, i want to detect if ANY button has been pressed on the document. If a button is pressed, get that button object, get it’s textContent and that’s all there is to it.
Tag: detect
Detect user exit site
I have an urge to detect when a user leaves my site in order to record accurately the session length of the user in question. I have thought of a couple possible solutions for this: I first thought I could use onbeforeunload and send a simple ajax to record the last activity but what practice has shown me is that