Ildar Galikov
Ildar Galikov

Reputation: 460

How to capture all fired events when I click in Internet Explorer

I've got a comprehensive navigation menu on a page. It has a lot of jQuery stuff and different attached events.

Then I have an annoying bug in all version of Internet Explorer, including version 11.

I wonder if there is a way to monitor all fired events when I click in a specific place of the page.

Upvotes: 0

Views: 370

Answers (1)

Ildar Galikov
Ildar Galikov

Reputation: 460

Here is the correct answer:

"Appending some code to the question and describing the bug would be helpful. Use e.target to find the origin of the object clicked. api.jquery.com/event.target – Shikkediel"

Mini implementation details:

Add jQuery:

<head><script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head>

And the following code somewhere between <body></body> tags:

<div id="log"></div>
<div>
    <p>
        <strong><span>click</span></strong>
    </p>
</div>

<script>
    $("body").click(function(event) {
        $("#log").html("clicked: " + event.target.nodeName);
    });
</script>

Once you click on the place on the screen you would find out which element was triggered.

Upvotes: 1

Related Questions