Hacker News new | ask | show | jobs
by lucideer 1073 days ago
> which the compiler picks up

I think this is the crux of the gp's question. The browser doesn't support explicit behaviours for "on:click" or "|once" (the "$" label is a cool trick I'd forgive the gp for not recognising as native JS) - it may be "valid" HTML but it's not "just HTML" (nor just JS), it's a DSL.

1 comments

It does support onclick though. This isn't a far off derivation. Also "|once" is a whole lot cleaner and more terse than the "once" variant of addEventListener, to be sure.

Anyone who already knows HTML and native event handling could pick this up in less than 5 minutes. Good enough.