A
A
Anton Shamanov2019-09-15 20:48:19
JavaScript
Anton Shamanov, 2019-09-15 20:48:19

How to correct the display of events in the Firefox DOM inspector?

When events are added to elements "indirectly" (by the way, what is the correct name for this in the context of js?), then in the FF inspector they are displayed only for the parent i.e. in this example, the .btn click event occurs, but the tooltip is displayed on the body tag. Is there any way to add tooltips to .btn child elements as well without "outweighing" events from body to .btn? Any engineering settings for FF or at least some simple way to rebind events?
$('body').on('click', '.btn', function (e) {

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2019-09-15
@Flying

This construction is specific to jQuery and essentially means that the real handler is hung on the body, but it has an additional Event.target check for a match with the specified selector.
Thus, the browser does not (and cannot) know about this behavior, so it only shows the real handler that exists.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question