News for hackers. Stuff that matters.
Re:HTML event handler attributes: down the rabbit hole by lifthrasiir on Tuesday April 26, 2022 @05:55PM (#31173673)
> I'm not sure what `$name` is but `$body` is the string passed to the handler attribute in HTML.

The name of the synthesized function is the attribute name itself. So `<button onclick="alert(arguments.callee.name)">` will alert "onclick" on click.

Re:HTML event handler attributes: down the rabbit hole by hnbad on Wednesday April 27, 2022 @04:45AM (#31177731)
Yeah, the paragraph immediately preceding the one giving the signature starts with "if $name is onerror" so that's clearly referencing the name of the attribute.

I wonder if the name also reflects capitalization given that HTML element and attribute names are generally case insensitive.

Re:HTML event handler attributes: down the rabbit hole by eatonphil on Tuesday April 26, 2022 @05:56PM (#31173677)
Good example. Thank you!