[whatwg] Thoughts on HTML 5

Garrett Smith dhtmlkitchen at gmail.com
Wed Dec 17 19:31:39 PST 2008


On Tue, Dec 16, 2008 at 5:14 AM, Giovanni Campagna
<scampa.giovanni at gmail.com> wrote:
> Maybe so-called "invalid" HTML attributes are not the only solution, but in
> my opinion it is a simple way to embed metadata within any element.
>
> Imagine that such markup is then passed to a web application through XHR. In
> that case scripts aren't parsed and executed. In this case you have three
> ways to attach a behaviour:
>
> 2) on-event standard attributes (but they not performant since they're
> parsed every time the event fires and the cannot include chars like > or ",
> they need to be escaped)
> 3) assigning a "class" and some metadata using "data-", then
> getElementsByClassName and addEventListener
>

What is the first way?

I usually prefer to use bubbling.

If the callback has an event target that it is interested in, it can
deal with it at that time.

Garrett



More information about the whatwg mailing list