Md. Imran Ali
Md. Imran Ali

Reputation: 11

How to access event.clientX outside of window function?

I tried to use the event.clientX outside of window function. But it says xAxis is not defined. Can have an way to get it? My code below,

window.onclick = function(event) {
        let xAxis = event.clientX;
}
alert(xAxis);

Upvotes: 1

Views: 75

Answers (0)

Related Questions