 added a variable

var Hello = {
    view: function() {
        return m(&quot;main&quot;, [
            m(&quot;h1&quot;, {class: &quot;title&quot;}, &quot;My first app&quot;),
            // changed the next line
            m(&quot;button&quot;, {onclick: function() {count++}}, count + &quot; clicks&quot;),
        ])
    }
}

m.mount(root, Hello)
</code></pre>
<p>We defined an <code>onclick</code> event on the button, which increments a variable <code>count</code> (which was declared at the top). We are