The me/myself/my Reference




Most hyperscript features run within the context of an HTML element. For example, <div _="on click ..."> is an event handler that runs in the context of the <div> that contains it. Within these scripts, you can use the me expression as a link back to their associated HTML element.

You can also use myself if that is more readable in English.

For possessive expressions, my will also work, as in my property instead of


This uses the put command to update the contents of the associated element.

<button data-script="on click put 'I have been clicked' into me">
    click me

This uses a possessive expression and an attribute reference to display a custom message.

    data-script="on mouseover alert my @data-message" 
    data-message="Keep Out!">
    Hover Over Me...

This demonstrates the possessive expression along with the increment command to makes a simple click counter.

<div data-script="on click increment my innerHTML">1</div>