- From: Michaël Rouges <michael.rouges@gmail.com>
- Date: Sun, 26 May 2013 23:21:28 +0200
- To: public-html@w3.org
Received on Sunday, 26 May 2013 21:21:56 UTC
Hi Robin,
Thank you for this advice and I agree with you on the fact of having to do more
to support an example of this kind.
In fact, my example was a bit simplistic. However, with a more complex
selector, the QueryEventListeners would prove almost necessary for light
development.
Imagine, for example, that we want to apply an event to any element
corresponding
to:
document.querySelector('section:nth-of-type(3n+0) p[data-sample="sample"
a[href^="./"]]');
Should miles of code and it would be very expensive in ressources, to
manage it.
Also, my original example shows a user event (onclick) but it could very
well imagine that the event is simply inserting a node matching the selector
, so, for example, putting in color, supplement content, etc..
Michaël
Received on Sunday, 26 May 2013 21:21:56 UTC